From 312f8906ae32aeb973ab6712decb060ff566ade7 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 18 Sep 2019 10:52:05 +0100 Subject: show "bad" data in HTTPParsingException message --- src/utils/http.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/utils/http.py') diff --git a/src/utils/http.py b/src/utils/http.py index a6a074ab..2207a86c 100644 --- a/src/utils/http.py +++ b/src/utils/http.py @@ -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, -- cgit v1.3.1-10-gc9f91