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

Conversation

ltalirz
Copy link
Member

@ltalirz ltalirz commented Feb 25, 2022

fix #1393

The dependencies for the AiiDA REST API are currently not installed by
default - only when users request the rest extra.

When users were starting the REST API without installing the extra, they
were greeted by an unhelpful/unexpected error message

ModuleNotFoundError: No module named 'flask_restful'

Here we catch ImportErrors upon starting the REST API and provide an
error message that includes instructions on how to remedy the situation.
For cases where the ImportError has another cause, the original
exception is carried along as well.

The dependencies for the AiiDA REST API are currently not installed by
default - only when users request the `rest` extra.

When users were starting the REST API without installing the extra, they
were greeted by an unhelpful/unexpected error message

	ModuleNotFoundError: No module named 'flask_restful'

Here we catch ImportErrors upon starting the REST API and provide an
error message that includes instructions on how to remedy the situation.
For cases where the ImportError has another cause, the original
exception is carried along as well.
Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks @ltalirz

@sphuber sphuber merged commit 7211f84 into aiidateam:develop Feb 27, 2022
@sphuber sphuber deleted the issue-1393-restapi-warn branch February 27, 2022 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REST API: instructions unclear when dependencies are missing
2 participants