aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Picard <cedric.picard@efrei.net>2014-11-28 19:33:32 +0100
committerCédric Picard <cedric.picard@efrei.net>2014-11-28 19:33:32 +0100
commit1b76a20a35bb3b0644a63d8c8c61a588788627b9 (patch)
tree0c99486dbee610881339d44fdd395d9f64d0d363
parent3ef2cc7e71fc89b99baac73500757839aa21923f (diff)
downloadpasteme-1b76a20a35bb3b0644a63d8c8c61a588788627b9.tar.gz
pasteme-1b76a20a35bb3b0644a63d8c8c61a588788627b9.tar.bz2
pasteme-1b76a20a35bb3b0644a63d8c8c61a588788627b9.zip
Added minor error management
-rwxr-xr-xscripts/pastit.py5
1 files changed, 5 insertions, 0 deletions
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