From c9861ca812c3670347217aade3cb045ff9ad7cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 18 Oct 2018 15:09:49 +0200 Subject: [PATCH] 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. --- gallery_dl/extractor/common.py | 2 +- test/test_results.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 0807effa..8905ff42 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -74,7 +74,7 @@ class Extractor(): response.encoding = encoding return response - msg = "{} HTTP Error: {} for url: {}".format( + msg = "{}: {} for url: {}".format( code, response.reason, url) if code < 500 and code != 429: break diff --git a/test/test_results.py b/test/test_results.py index aaec0fe1..a5a5c2c1 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -72,7 +72,7 @@ class TestExtractorResults(unittest.TestCase): except exception.StopExtraction: pass 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) raise