Skip to content

Configuration

Configuration errors shared by media processors, converters, and transformers.

ComponentConfigError(*, component, parameter, next_step, debug_info=None)

Bases: ComponentError, ValueError

Report an invalid or missing option for any multimodal component.

Use this during component setup when a required setting is absent or invalid, before a media operation starts.

Example

A converter is created without a required model name.

from gllm_multimodal.exceptions import ComponentConfigError

error = ComponentConfigError(
    component="Audio transcription",
    parameter="model_name",
    next_step="Configure a supported model name and try again.",
)
print(error.message)
Output:
Audio transcription needs a valid model_name. Configure a supported model name and try again.

Initialize the error with the component, option, and corrective action.

Parameters:

Name Type Description Default
component str

Name of the component with invalid or missing configuration.

required
parameter str

Required option or setting that needs correction.

required
next_step str

Action for supplying or correcting the parameter.

required
debug_info DebugInfo | None

Optional diagnostic context, sanitized before storage.

None

ComponentModelError(*, model, failure, debug_info=None)

Bases: ComponentError, RuntimeError

Report failure to obtain or prepare model weights during component setup.

Use this when downloading, caching, or verifying model weights fails.

Example

A detector downloads a built-in model, but the received file fails integrity verification.

from textwrap import fill
from gllm_multimodal.exceptions import ComponentModelError

error = ComponentModelError(model="ppocrv6_small", failure="integrity")
print(fill(error.message, width=100))
Output:
The ppocrv6_small model could not be prepared: its weights failed integrity verification. Retry the
download; if it repeats, ask the application owner to verify the model artifact.

Initialize a model preparation error with a specific recovery action.

Parameters:

Name Type Description Default
model str

Safe model identifier, without a directory path.

required
failure str

One of download, cache, lock, size_limit, integrity, or local_file.

required
debug_info DebugInfo | None

Optional diagnostic context, sanitized before storage.

None

Raises:

Type Description
ValueError

If the identifier or failure category is invalid.