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):
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()