solprop.recipe.errors#

The error a recipe raises when it cannot be read, checked or written.

Exceptions

RecipeError(message, *[, path])

A recipe, or a value in it, cannot be read, checked or written.

exception solprop.recipe.errors.RecipeError(message, *, path=None)[source]#

Bases: SolpropError, ValueError

A 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"), or None when 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 as parameter, which every SolpropError carries (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'
message: str#
path: str | None#