diff --git a/ctapipe/core/tool.py b/ctapipe/core/tool.py index dd036189a9f..46259f13d47 100644 --- a/ctapipe/core/tool.py +++ b/ctapipe/core/tool.py @@ -11,6 +11,7 @@ import yaml from docutils.core import publish_parts +from traitlets import TraitError try: import tomli as toml @@ -359,8 +360,9 @@ def run(self, argv=None, raises=False): self.finish() self.log.info(f"Finished: {self.name}") Provenance().finish_activity(activity_name=self.name) - except ToolConfigurationError as err: - self.log.error(f"{err}. Use --help for more info") + except (ToolConfigurationError, TraitError) as err: + self.log.error("%s", err) + self.log.error("Use --help for more info") exit_status = 2 # wrong cmd line parameter except KeyboardInterrupt: self.log.warning("WAS INTERRUPTED BY CTRL-C")