show "bad" data in HTTPParsingException message

This commit is contained in:
jesopo 2019-09-18 10:52:05 +01:00
parent a003c97fba
commit 312f8906ae

View file

@ -42,8 +42,9 @@ class HTTPTimeoutException(HTTPException):
def __init__(self):
Exception.__init__(self, "HTTP request timed out")
class HTTPParsingException(HTTPException):
def __init__(self, message: str, data: str=None):
Exception.__init__(self, message or "HTTP parsing failed")
def __init__(self, message: str, data: str):
Exception.__init__(self,
message or ("HTTP parsing failed:\n%s" % data))
class HTTPWrongContentTypeException(HTTPException):
def __init__(self, message: str=None):
Exception.__init__(self,