summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--patternutils/commands/prss.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/patternutils/commands/prss.py b/patternutils/commands/prss.py
index ec97985..79b9413 100644
--- a/patternutils/commands/prss.py
+++ b/patternutils/commands/prss.py
@@ -34,7 +34,16 @@ def prss(
url: str, directory: str, stream: bool, human_readable: bool, verbose: bool
) -> None:
- parsed_feed = feedparser.parse(url)
+ try:
+ parsed_feed = feedparser.parse(url)
+ except Exception:
+ click.secho("Reading feed failed!", fg="red", err=True)
+ raise SystemExit
+ else:
+ if not parsed_feed.version:
+ click.secho("Unsupported feed!", fg="red", err=True)
+ raise SystemExit
+
direntries = []
filenames = []