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

Add better handling of exceptions when API calls fail #2

Open
pluflou opened this issue Jan 23, 2024 · 0 comments
Open

Add better handling of exceptions when API calls fail #2

pluflou opened this issue Jan 23, 2024 · 0 comments

Comments

@pluflou
Copy link
Collaborator

pluflou commented Jan 23, 2024

When querying from data from the NREL API (particularly for ComStock) using the app UI, sometimes the notebook crashes from an HTTPError (404: Not Found), e.g. when querying marine climate ComStock data (building america data) which does not exist. Ideally the notebook should not crash and the exception should be handled gracefully.

This can be fixed in a couple of ways:

  • Adjust what options are shown in the drop-down menu to only show where data is available (probably not the best way to handle this, as data availability might change).
  • Add better handling of the exception thrown, and instead of the marimo app breaking, redirect to an available data option with a clear error statement of what wasn't available.

This should also be added at the sg2t level https://github.com/slacgismo/sg2t/blob/main/sg2t/io/loadshapes/nrel/api.py where these calls are being made.

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

No branches or pull requests

1 participant