Skip to content

Exceptions

trimbed.exceptions

Custom exceptions for trimbed.

MissingDependencyError

MissingDependencyError(
    package: str, extra: str, purpose: str
)

Bases: ImportError

An optional dependency is required for the requested operation but is not installed.

Subclasses ImportError, so except ImportError still catches it, while the message can name the extra to install.

Build the error.

Parameters:

Name Type Description Default
package str

Import name of the missing package.

required
extra str

Name of the optional-dependency extra that provides it.

required
purpose str

Short description of what the package is needed for.

required