solprop.recipe.errors#
The error a recipe raises when it cannot be read, checked or written.
Exceptions
|
A recipe, or a value in it, cannot be read, checked or written. |
- exception solprop.recipe.errors.RecipeError(message, *, path=None)[source]#
Bases:
SolpropError,ValueErrorA recipe, or a value in it, cannot be read, checked or written.
- Parameters:
- messagestr
What is wrong, and where it can be, what to write instead.
- pathstr or None, optional
The canonical parameter path of the value refused (
"pressure","pulses[1].energy"), orNonewhen the error concerns the document rather than one value. When given, the message starts with it.
- Attributes:
- messagestr
The message without the path.
- pathstr or None
The parameter path given, or
None; the same asparameter, which everySolpropErrorcarries (SEP 41, S10).
Examples
>>> error = RecipeError("a pressure cannot be negative", path="pressure") >>> error.path, error.parameter ('pressure', 'pressure') >>> str(error) 'pressure: a pressure cannot be negative'