From 1b76a20a35bb3b0644a63d8c8c61a588788627b9 Mon Sep 17 00:00:00 2001 From: Cédric Picard Date: Fri, 28 Nov 2014 19:33:32 +0100 Subject: Added minor error management --- scripts/pastit.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/pastit.py b/scripts/pastit.py index e515c40..3a61e19 100755 --- a/scripts/pastit.py +++ b/scripts/pastit.py @@ -39,6 +39,11 @@ def get(url): except requests.exceptions.ConnectionError as e: sys.exit(e) + if req.status_code == 404: + return "Paste not found" + elif not req.ok: + return "An error occured" + return req.text -- cgit v1.2.3