diff options
author | Christopher Rosell <chrippa@tanuki.se> | 2012-05-24 15:07:03 +0200 |
---|---|---|
committer | Christopher Rosell <chrippa@tanuki.se> | 2012-05-24 15:07:03 +0200 |
commit | e4c07414d077964613da5b7870a49f0882f703b1 (patch) | |
tree | e370b20faff00c33db6914e6c744b7b75ff55e96 /src/livestreamer/cli.py | |
parent | 5afb1f0917214697045c904c6af4fe2ddf43818f (diff) |
Add more plugin exceptions.
Diffstat (limited to 'src/livestreamer/cli.py')
-rw-r--r-- | src/livestreamer/cli.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/livestreamer/cli.py b/src/livestreamer/cli.py index 6d7aac5..d8d1bc0 100644 --- a/src/livestreamer/cli.py +++ b/src/livestreamer/cli.py @@ -19,18 +19,18 @@ def exit(msg): sys.exit() def handle_url(args): - channel = livestreamer.resolve_url(args.url) - - if not channel: - exit(("No plugin can handle url: {0}").format(args.url)) + try: + channel = livestreamer.resolve_url(args.url) + except livestreamer.NoPluginError: + exit(("No plugin can handle URL: {0}").format(args.url)) try: streams = channel.get_streams() except livestreamer.PluginError as err: - exit(("Error from plugin while retrieving streams: {0}").format(err)) + exit(str(err)) if len(streams) == 0: - exit(("No streams found on url: {0}").format(args.url)) + exit(("No streams found on this URL: {0}").format(args.url)) keys = list(streams.keys()) keys.sort() |