Skip to content

Commit

Permalink
Merge pull request #263 from andypbarrett/fix-download-issue262
Browse files Browse the repository at this point in the history
add try block to return useful error message for failed download
  • Loading branch information
betolink authored Jul 22, 2023
2 parents c173121 + 34d884c commit 068a269
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion earthaccess/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,13 @@ def download(
Returns:
List of downloaded files
"""
results = earthaccess.__store__.get(granules, local_path, provider, threads)
try:
results = earthaccess.__store__.get(granules, local_path, provider, threads)
except AttributeError as err:
print(err)
print("You must call earthaccess.login() before you can download data")
return None

return results


Expand Down

0 comments on commit 068a269

Please sign in to comment.