]> git.scottworley.com Git - paperdoorknob/commitdiff
FakeFetcher: Show bad URLs in error messages
authorScott Worley <scottworley@scottworley.com>
Thu, 28 Dec 2023 23:13:11 +0000 (15:13 -0800)
committerScott Worley <scottworley@scottworley.com>
Thu, 28 Dec 2023 23:13:11 +0000 (15:13 -0800)
fetch.py

index 1d2070183a44dded893850630f68d6c2b9c06bb9..b99938c055fe8a2fc31f951404ed497849e5dcff 100644 (file)
--- a/fetch.py
+++ b/fetch.py
@@ -89,7 +89,7 @@ class FakeFetcher(Fetcher):
     def fetch(self, url: str) -> bytes:
         self._fetch_count += 1
         if url not in self._resources:
-            raise requests.HTTPError("URL not found")
+            raise requests.HTTPError("URL not found", url)
         return self._resources[url]
 
     def request_count(self) -> int: