lightbulb.exceptions

Module containing exceptions raised by lightbulb internals. Exceptions raised by built-in hooks (prefab package) are instead kept within that package. See the lightbulb.prefab documentation page for their reference. Similarly, exceptions raised by the dependency injection system are contained in the lightbulb.di subpackage.

exception ExecutionException[source]

Base class for exceptions that can be encountered during a command execution pipeline.

exception ExecutionPipelineFailedException(failed_hooks_with_exceptions: Sequence[tuple[ExecutionHook, Exception]], invocation_failure: Exception | None, pipeline: ExecutionPipeline, context: context_.Context)[source]

Exception raised when the execution of any step during command invocation failed. This is the exception type passed to all error handlers.

If during execution, only a single exception was raised, the __cause__ attribute will be set to that exception.

causes: Sequence[Exception]

All the exceptions raised during command execution.

context: context_.Context

The context that caused the pipeline to fail.

failed_hooks: Sequence[ExecutionHook]

The hooks that failed during command execution. The corresponding exception can be found at the same index in hook_failures.

hook_failures: Sequence[Exception]

The exceptions caused by hook failures during command execution.

invocation_failure: Exception | None

The exception caused by the invocation method failing during command execution. Will be None if the invocation method did not fail or was not executed.

pipeline: ExecutionPipeline

The pipeline that failed.

exception LightbulbException[source]

Base class for all exceptions used by lightbulb.

exception LocalizationFailedException[source]

Exception raised when a command or option is marked as being localized, but a value for the name or description could not be resolved.