bundles / traitlets 5.16.2 / traitlets / traitlets / TraitType / error
function
traitlets.traitlets:TraitType.error
source: /traitlets/traitlets.py:809
Signature
def error(self, obj: HasTraits | None, value: t.Any, error: Exception | None = None, info: str | None = None) → t.NoReturnSummary
Raise a TraitError
Parameters
obj: HasTraits or NoneThe instance which owns the trait. If not object is given, then an object agnostic error will be raised.
value: anyThe value that caused the error.
error: Exception (default: None)An error that was raised by a child trait. The arguments of this exception should be of the form
(value, info, *traits). Where thevalueandinfoare the problem value, and string describing the expected value. Thetraitsare a series of TraitType instances that are "children" of this one (the first being the deepest).info: str (default: None)A description of the expected value. By default this is inferred from this trait's
infomethod.
Aliases
traitlets.TraitType.error