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 try block to return useful error message for failed download #263

Merged
merged 1 commit into from
Jul 22, 2023

Conversation

andypbarrett
Copy link
Collaborator

@andypbarrett andypbarrett commented Jul 21, 2023

This PR address #262.

Following the api workflow in the readme, if earthaccess.login() is not executed before download, download fails with an ambiguous AttributeError. To fix this, I added a try-except block to download in api.py, so that the user is advised to run earthdata.login() before attempting to download and None is returned.

@github-actions
Copy link

Binder 👈 Launch a binder notebook on this branch for commit 34d884c

I will automatically update this comment whenever this PR is modified

@andypbarrett andypbarrett linked an issue Jul 21, 2023 that may be closed by this pull request
Copy link
Member

@betolink betolink left a comment

Choose a reason for hiding this comment

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

Thanks Andy! maybe down the road we should handle the error in the store class so when that happens is not the API that sounds the alarm.

@betolink betolink merged commit 068a269 into nsidc:main Jul 22, 2023
2 of 6 checks passed
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.

earthaccess.download fails for on-prem access
2 participants