Commit ee78ba2c authored by Shoham Peller's avatar Shoham Peller Committed by Miss Islington (bot)

[2.7] closes bpo-8450: a better error message when http status line isn't received (GH-2825)



When the server has closed the connection before sending a status-line,
the client's error message should have a more descriptive error message

https://bugs.python.org/issue8450


https://bugs.python.org/issue8450
parent 85755031
......@@ -399,7 +399,7 @@ class HTTPResponse:
if not line:
# Presumably, the server closed the connection before
# sending a valid response.
raise BadStatusLine(line)
raise BadStatusLine("No status line received - the server has closed the connection")
try:
[version, status, reason] = line.split(None, 2)
except ValueError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment