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
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