Skip to content

redsun.errors

The exceptions a session raises. redsun re-exports each of them.

The exceptions a session raises.

BuildError

Bases: RuntimeError

Raised when a strict session could not build or set up a component.

ConfigurationError

ConfigurationError(
    sources: Sequence[str], problems: Sequence[str]
)

Bases: ValueError

Raised when a session file, once its layers are merged, says what a session cannot.

Parameters:

Name Type Description Default
sources Sequence[str]

The sources the configuration was read from, as the message names them: a file path, or an inline mapping.

required
problems Sequence[str]

One line for each problem, as section.key: what.

required

ConfigurationInUse

ConfigurationInUse(path: Path)

Bases: OSError

Raised when a session is asked to write over a source it was built from.

path instance-attribute

path = path

The source the session was asked to write over.

HookError

Bases: RuntimeError

Raised when a hook is declared wrongly or its provider cannot serve.

A hook is declared wrongly when it names no class, a point the session does not call, a point another provider already takes, or the same provider and keys as another hook. A provider cannot serve when it cannot be imported or built, does not implement its hook point, or returns what the point cannot use.

PluginError

Bases: RuntimeError

Raised when a configuration entry names a plugin, group or id that does not resolve.