Skip to content

add try block to return useful error message for failed download#263

Merged
betolink merged 1 commit intoearthaccess-dev:mainfrom
andypbarrett:fix-download-issue262
Jul 22, 2023
Merged

add try block to return useful error message for failed download#263
betolink merged 1 commit intoearthaccess-dev:mainfrom
andypbarrett:fix-download-issue262

Conversation

@andypbarrett
Copy link
Copy Markdown
Contributor

@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
Copy Markdown

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

I will automatically update this comment whenever this PR is modified

@andypbarrett andypbarrett requested a review from betolink July 21, 2023 22:30
@andypbarrett andypbarrett linked an issue Jul 21, 2023 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@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 earthaccess-dev:main Jul 22, 2023
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