Errors#

The exception types the framework raises. All inherit from a single base, so you can catch every framework error with one except clause or narrow to a specific failure.

For when each one is raised and how to handle it, see the Errors guide.

exception bootstack.errors.BootstackError#

Bases: Exception

Base class for all public API errors.

exception bootstack.errors.DuplicateIdError#

Bases: BootstackError

Raised when a data source receives a record whose id already exists.

Record ids must be unique — they identify rows for selection and events.

exception bootstack.errors.InvalidChoiceError#

Bases: BootstackError, ValueError

Raised when a keyword argument is given a value outside its valid set.

Applies to arguments that name a behavior mode drawn from a closed set, such as selection_mode or scrollbars. The message names the value that was rejected and lists the values that are accepted.

Also a ValueError, so either BootstackError or ValueError catches it.

exception bootstack.errors.NavigationError#

Bases: BootstackError

Raised when a navigation operation references a wrong key.

Examples: adding a page, tab, or workspace whose key already exists, or selecting, looking up, or removing one whose key does not exist.

exception bootstack.errors.ParentResolutionError#

Bases: BootstackError

Raised when a widget cannot resolve its parent.

exception bootstack.errors.SerializationError#

Bases: BootstackError

Raised when a file-backed store or data source receives a value it cannot persist.

File- and database-backed sources carry non-scalar fields as JSON, and Store persists its values as JSON, so values must be JSON-serializable (scalars, lists, dicts). Store arbitrary Python objects in an in-memory source instead.

exception bootstack.errors.StyleBuilderError#

Bases: BootstackError

Raised when a widget style cannot be built.

Examples: an unsupported variant for a widget, or a missing required theme color token.

exception bootstack.errors.ThemeError#

Bases: BootstackError

Raised when a theme-related operation fails.

Examples: requesting an unknown theme name, or loading a malformed theme definition.

exception bootstack.errors.UnknownEventError#

Bases: BootstackError

Raised by widget.on(name, ...) when name cannot be resolved.