Give descriptions to utils.http.HTTPException subclasses

This commit is contained in:
jesopo 2019-06-27 18:28:08 +01:00
parent 9c5c8cf563
commit 97810db8df

View file

@ -15,11 +15,15 @@ SOUP_CONTENT_TYPES = ["text/html", "text/xml", "application/xml"]
class HTTPException(Exception): class HTTPException(Exception):
pass pass
class HTTPTimeoutException(HTTPException): class HTTPTimeoutException(HTTPException):
pass def __init__(self):
Exception.__init__(self, "HTTP request timed out")
class HTTPParsingException(HTTPException): class HTTPParsingException(HTTPException):
def __init__(self):
Exception.__init__(self, "HTTP parsing failed")
pass pass
class HTTPWrongContentTypeException(HTTPException): class HTTPWrongContentTypeException(HTTPException):
pass def __init__(self):
Exception.__init__(self, "HTTP request gave wrong content type")
def throw_timeout(): def throw_timeout():
raise HTTPTimeoutException() raise HTTPTimeoutException()