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

Handle 403 error #817

Open
ksauzz opened this issue Jun 16, 2023 · 1 comment
Open

Handle 403 error #817

ksauzz opened this issue Jun 16, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ksauzz
Copy link
Contributor

ksauzz commented Jun 16, 2023

We sometimes observed https://api.materialsproject.org/heartbeat responds a 403 error, then mp-api just raises JSONDecodeError.
It would be nice to show users a 403 error, and what could happen such as rate limit or something.

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

refs:
https://matsci.org/t/pymatgen-ext-matproj-mpresterror-rest-query-returned-with-error-status-code-403-content-berror-code-1020/47992
https://matsci.org/t/mpresterror-rest-query-returned-with-error-status-code-403/792

@munrojm
Copy link
Member

munrojm commented Jun 20, 2023

Yes, I agree with this. The client should communicate better when the API service appears to be unreachable.

@munrojm munrojm added the enhancement New feature or request label Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants