diff --git a/src/anemoi/utils/cli.py b/src/anemoi/utils/cli.py index 58698c7f..ccb7229e 100644 --- a/src/anemoi/utils/cli.py +++ b/src/anemoi/utils/cli.py @@ -265,10 +265,13 @@ def cli_main( else: cmd.run(args) except ValueError as e: - if test_arguments: raise + if sys.excepthook is not sys.__excepthook__: + # re-raise exception if non-default excepthook is set (e.g. in pdb) + raise + traceback.print_exc() LOG.error("\nšŸ’£ %s", str(e).lstrip()) LOG.error("šŸ’£ Exiting")