adjust message for status_code based exceptions

from: 5xx HTTP Error: Reason
to  : 5xx: Reason

The "HTTP Error" part was in there to emulate Request's error messages
from response.raise_for_status(), but it reads a lot better without.
This commit is contained in:
Mike Fährmann 2018-10-18 15:09:49 +02:00
parent eb1c24b286
commit c9861ca812
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ class Extractor():
response.encoding = encoding response.encoding = encoding
return response return response
msg = "{} HTTP Error: {} for url: {}".format( msg = "{}: {} for url: {}".format(
code, response.reason, url) code, response.reason, url)
if code < 500 and code != 429: if code < 500 and code != 429:
break break

View File

@ -72,7 +72,7 @@ class TestExtractorResults(unittest.TestCase):
except exception.StopExtraction: except exception.StopExtraction:
pass pass
except exception.HttpError as exc: except exception.HttpError as exc:
if re.match(r"5\d\d HTTP Error:", str(exc)): if re.match(r"5\d\d: ", str(exc)):
self.skipTest(exc) self.skipTest(exc)
raise raise