also show "bad" data in HTTPParsingException when a message is provided

This commit is contained in:
jesopo 2019-09-18 14:20:59 +01:00
parent d5b9da7659
commit cd0d39ee5e

View file

@ -44,7 +44,7 @@ class HTTPTimeoutException(HTTPException):
class HTTPParsingException(HTTPException):
def __init__(self, message: str, data: str):
Exception.__init__(self,
message or ("HTTP parsing failed:\n%s" % data))
"%s\n%s" % ((message or "HTTP parsing failed"), data))
class HTTPWrongContentTypeException(HTTPException):
def __init__(self, message: str=None):
Exception.__init__(self,