IMAP-Science-Operations-Center / imap-data-access

Package to download, query, and upload files from the IMAP Science Data Center.
MIT License
0 stars 8 forks source link

FIX: Catch errors when using the CLI #9

Closed greglucas closed 5 months ago

greglucas commented 5 months ago

This avoids the stack traces and only prints the messages of what hapened with the server errors instead.

Are these print statements what you'd expect to see as a user?

$ imap-data-access download a/b/c.txt
HTTP Error: 502 - Bad Gateway
Server Message: {"message": "Internal server error"}
sdhoyt commented 5 months ago

Sorry, just seeing this now. That's weird that it was bad gateway, download api should return this if there's no file found:

http_response(status_code=404, body="File not found in S3.")