From e4c07414d077964613da5b7870a49f0882f703b1 Mon Sep 17 00:00:00 2001 From: Christopher Rosell Date: Thu, 24 May 2012 15:07:03 +0200 Subject: Add more plugin exceptions. --- src/livestreamer/cli.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/livestreamer/cli.py') 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() -- cgit v1.2.3