Make toot instance work with localhost

Asserting the domain exists does not bring much value.
This commit is contained in:
Ivan Habunek 2022-11-27 09:56:04 +01:00
parent d308475afe
commit ebc17e0764
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
1 changed files with 2 additions and 4 deletions

View File

@ -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)