Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: better error message when flask not installed #5398

Merged
merged 1 commit into from
Feb 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions aiida/cmdline/commands/cmd_restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,17 @@ def restapi(hostname, port, config_dir, debug, wsgi_profile, posting):
from aiida.restapi.run_api import run_api

# Invoke the runner
run_api(
hostname=hostname,
port=port,
config=config_dir,
debug=debug,
wsgi_profile=wsgi_profile,
posting=posting,
)
try:
run_api(
hostname=hostname,
port=port,
config=config_dir,
debug=debug,
wsgi_profile=wsgi_profile,
posting=posting,
)
except ImportError as exc:
raise ImportError(
'Failed to import modules required for the REST API. '
'You may need to install the `rest` extra, e.g. via `pip install aiida-core[rest]`.'
) from exc