mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-23 05:35:49 +00:00
improve BadStatusLine exception message
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3452 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
04f89d0668
commit
229e352c0c
1 changed files with 4 additions and 4 deletions
|
|
@ -300,7 +300,7 @@ class HTTPResponse:
|
||||||
if not line:
|
if not line:
|
||||||
# Presumably, the server closed the connection before
|
# Presumably, the server closed the connection before
|
||||||
# sending a valid response.
|
# sending a valid response.
|
||||||
raise BadStatusLine(line)
|
raise BadStatusLine("Bad status line %r" % line)
|
||||||
try:
|
try:
|
||||||
[version, status, reason] = line.split(None, 2)
|
[version, status, reason] = line.split(None, 2)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
@ -314,7 +314,7 @@ class HTTPResponse:
|
||||||
if not version.startswith('HTTP/'):
|
if not version.startswith('HTTP/'):
|
||||||
if self.strict:
|
if self.strict:
|
||||||
self.close()
|
self.close()
|
||||||
raise BadStatusLine(line)
|
raise BadStatusLine("Bad status line %r" % line)
|
||||||
else:
|
else:
|
||||||
# assume it's a Simple-Response from an 0.9 server
|
# assume it's a Simple-Response from an 0.9 server
|
||||||
self.fp = LineAndFileWrapper(line, self.fp)
|
self.fp = LineAndFileWrapper(line, self.fp)
|
||||||
|
|
@ -324,9 +324,9 @@ class HTTPResponse:
|
||||||
try:
|
try:
|
||||||
status = int(status)
|
status = int(status)
|
||||||
if status < 100 or status > 999:
|
if status < 100 or status > 999:
|
||||||
raise BadStatusLine(line)
|
raise BadStatusLine("Bad status line %r" % line)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise BadStatusLine(line)
|
raise BadStatusLine("Bad status line %r" % line)
|
||||||
return version, status, reason
|
return version, status, reason
|
||||||
|
|
||||||
def begin(self):
|
def begin(self):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue