{ } Raw JSON

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 None

The instance which owns the trait. If not object is given, then an object agnostic error will be raised.

value : any

The 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 the value and info are the problem value, and string describing the expected value. The traits are 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 info method.

Aliases

  • traitlets.TraitType.error