about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/fead.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fead.py b/src/fead.py
index 5987020..5c42116 100755
--- a/src/fead.py
+++ b/src/fead.py
@@ -171,7 +171,10 @@ async def fetch(raw_url):
                  type('RedirectWarning', (Warning,), {}))
             return await fetch(location)
         if response.status >= 200:
-            xml = parse_xml(response.read())
+            try:
+                xml = parse_xml(response.read())
+            except SyntaxError as e:
+                raise ValueError(f'malformed XML at {raw_url}') from e
             if xml.tag == 'rss':
                 assert xml[0].tag == 'channel'
                 src_title, src_link, items = parse_rss(xml[0], url.hostname)