aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/ScraperSourcePlugin.py
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2023-09-25 10:11:28 +0300
committerJan Tuomi <jans.tuomi@gmail.com>2023-09-25 10:11:28 +0300
commitbd77148bef39829350670856706b48ad35837df1 (patch)
tree131d42bbb5eb9e62ea3b844de6bfc3747129e71b /plugins/ScraperSourcePlugin.py
parented5fbd131fad269074a461084834e40f5915ca8f (diff)
Improve http error logging
Diffstat (limited to 'plugins/ScraperSourcePlugin.py')
-rw-r--r--plugins/ScraperSourcePlugin.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/ScraperSourcePlugin.py b/plugins/ScraperSourcePlugin.py
index eb5e526..dd7e757 100644
--- a/plugins/ScraperSourcePlugin.py
+++ b/plugins/ScraperSourcePlugin.py
@@ -53,7 +53,9 @@ class Plugin(PluginInterface):
try:
resp = session.get(url, allow_redirects=True)
if resp.status_code >= 400:
- raise Exception("status_code >= 400")
+ ex = Exception(f"status_code >= 400, got {resp.status_code}")
+ ex.add_note(resp.text[0:1000])
+ raise ex
except Exception as ex:
ex.add_note(f"{self.log_prefix} failed to fetch page, url: {url}")
raise