Skip to content

Commit

Permalink
Better error message on tool configuration failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kosack committed Aug 3, 2023
1 parent deab982 commit 01ac44b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ctapipe/core/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ def run(self, argv=None, raises=False):

# check for any traitlets warnings using our custom handler
if len(self.trait_warning_handler.errors) > 0:
raise ToolConfigurationError("Found config errors")
raise ToolConfigurationError(
f"Found config errors: {self.trait_warning_handler.errors}"
)

# remove handler to not impact performance with regex matching
self.log.removeHandler(self.trait_warning_handler)
Expand Down

0 comments on commit 01ac44b

Please sign in to comment.