diff --git a/toot/commands.py b/toot/commands.py index c4903d1..b48f2a2 100644 --- a/toot/commands.py +++ b/toot/commands.py @@ -4,7 +4,7 @@ import sys from toot import api, config from toot.auth import login_interactive, login_browser_interactive, create_app_interactive -from toot.exceptions import ConsoleError, NotFoundError +from toot.exceptions import ApiError, ConsoleError, NotFoundError from toot.output import (print_out, print_instance, print_account, print_acct_list, print_search_results, print_timeline, print_notifications) from toot.utils import assert_domain_exists, editor_input, multiline_input, EOF_KEY @@ -331,12 +331,10 @@ def instance(app, user, args): if not name: raise ConsoleError("Please specify instance name.") - assert_domain_exists(name) - try: instance = api.get_instance(name, args.scheme) print_instance(instance) - except NotFoundError: + except ApiError: raise ConsoleError( "Instance not found at {}.\n" "The given domain probably does not host a Mastodon instance.".format(name)