bundles / traitlets 5.15.0 / traitlets / traitlets / TraitType / error
function
traitlets.traitlets:TraitType.error
source: /traitlets/traitlets.py :771
Signature
def error ( self , obj : HasTraits | None , value : t.Any , error : Exception | None = None , info : str | None = None ) → t.NoReturn Summary
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