Skip to content

Commit

Permalink
MNT: Exit with a parser error from the CLI
Browse files Browse the repository at this point in the history
If there is an error currently we print out a long stack trace. We
can change this to just print the error message through a parser
error rather than via the full stack trace when using this package
as a CLI utility.
  • Loading branch information
greglucas committed Apr 18, 2024
1 parent 476c3b9 commit 4df3acd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion imap_data_access/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ def main():

# Now process through the respective function for the invoked command
# (set with set_defaults on the subparsers above)
args.func(args)
try:
args.func(args)
except Exception as e:
parser.error(e)


if __name__ == "__main__":
Expand Down

0 comments on commit 4df3acd

Please sign in to comment.