diff options
| author | 2019-06-27 18:28:08 +0100 | |
|---|---|---|
| committer | 2019-06-27 18:28:08 +0100 | |
| commit | 97810db8df786143fd500fc68483d214a336f7f0 (patch) | |
| tree | d2caf0590dfa1a2b436e8213185ee26a880ac0e0 /src | |
| parent | seems i completely forgot try/except syntax (diff) | |
| signature | ||
Give descriptions to utils.http.HTTPException subclasses
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils/http.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/utils/http.py b/src/utils/http.py index 5dac7e90..ac46ce6b 100644 --- a/src/utils/http.py +++ b/src/utils/http.py @@ -15,11 +15,15 @@ SOUP_CONTENT_TYPES = ["text/html", "text/xml", "application/xml"] class HTTPException(Exception): pass class HTTPTimeoutException(HTTPException): - pass + def __init__(self): + Exception.__init__(self, "HTTP request timed out") class HTTPParsingException(HTTPException): + def __init__(self): + Exception.__init__(self, "HTTP parsing failed") pass class HTTPWrongContentTypeException(HTTPException): - pass + def __init__(self): + Exception.__init__(self, "HTTP request gave wrong content type") def throw_timeout(): raise HTTPTimeoutException() |
