diff options
author | Cédric Picard <cedric.picard@efrei.net> | 2014-11-28 19:33:32 +0100 |
---|---|---|
committer | Cédric Picard <cedric.picard@efrei.net> | 2014-11-28 19:33:32 +0100 |
commit | 1b76a20a35bb3b0644a63d8c8c61a588788627b9 (patch) | |
tree | 0c99486dbee610881339d44fdd395d9f64d0d363 | |
parent | 3ef2cc7e71fc89b99baac73500757839aa21923f (diff) | |
download | pasteme-1b76a20a35bb3b0644a63d8c8c61a588788627b9.tar.gz pasteme-1b76a20a35bb3b0644a63d8c8c61a588788627b9.tar.bz2 pasteme-1b76a20a35bb3b0644a63d8c8c61a588788627b9.zip |
Added minor error management
-rwxr-xr-x | scripts/pastit.py | 5 |
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 |