Skip to content

Error handling#108

Merged
mtinning merged 9 commits intomasterfrom
error-handling
Mar 18, 2020
Merged

Error handling#108
mtinning merged 9 commits intomasterfrom
error-handling

Conversation

@phil-brad
Copy link
Member

Added error handling to catch case where evaluator does not recognise parameter argument

@phil-brad phil-brad requested a review from mtinning December 20, 2019 00:54
mtinning
mtinning previously approved these changes Mar 17, 2020
Copy link
Member

@mtinning mtinning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor pointer if you want it, otherwise good!

return evaluate(arg, **kwargs) if isinstance(arg, ValueProxy) else arg
except ParameterNotFoundError as ex:
evaluator_name = self._name or type(self).__name__
raise EvaluatorParameterNotFoundError(ex.parameter_name, evaluator_name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the syntax raise new_exception from original_exception - this makes things a bit clearer in the trace

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok - implemented

@mtinning mtinning merged commit cc95bf4 into master Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants