Skip to content

Commit

Permalink
Improves command line error output (#54)
Browse files Browse the repository at this point in the history
* Handle application errors at the parser level

* Adds missing newline
  • Loading branch information
djperrefort authored Oct 13, 2023
1 parent 5e7a89c commit 4343876
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lmod_ingest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,9 @@ def main() -> None: # pragma: nocover
# Parse arguments and pass them to the appropriate function
parser = create_parser()
args = vars(parser.parse_args())
args.pop('callable')(**args)

try:
args.pop('callable')(**args)

except Exception as exc:
parser.error(message=str(exc))

0 comments on commit 4343876

Please sign in to comment.