aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/http/http2/framereader.py
diff options
context:
space:
mode:
Diffstat (limited to 'netlib/http/http2/framereader.py')
-rw-r--r--netlib/http/http2/framereader.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/netlib/http/http2/framereader.py b/netlib/http/http2/framereader.py
index d45be646..eb9b069a 100644
--- a/netlib/http/http2/framereader.py
+++ b/netlib/http/http2/framereader.py
@@ -1,6 +1,7 @@
import codecs
import hyperframe
+from ...exceptions import HttpException
def http2_read_raw_frame(rfile):
@@ -8,7 +9,7 @@ def http2_read_raw_frame(rfile):
length = int(codecs.encode(header[:3], 'hex_codec'), 16)
if length == 4740180:
- raise ValueError("Length field looks more like HTTP/1.1: %s" % rfile.peek(20))
+ raise HttpException("Length field looks more like HTTP/1.1:\n{}".format(rfile.read(-1)))
body = rfile.safe_read(length)
return [header, body]