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

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

FIX: Provide non-zero exit code when an action fails #44

Closed greglucas closed 3 weeks ago

greglucas commented 3 weeks ago

Change Summary

Overview

We were catching the exception and printing the message to format the string nicer and not raise errors from the cli. But, when testing with another command line program we weren't getting a known error due to the zero exit code. This moves the handling of the try/except up into the parser and just directly exits with a non-zero exit code.

Testing

# Now no longer a Python traceback with the ValueError
imap-data-access --data-dir /a/b/c upload a/b/c

# Now a 1 exit code (file doesn't exist)
imap-data-access download imap_codice_l1a_hskp_20240515_v001.cdf