Skip to content

Configuration Error

configuration_error

Configuration error for invalid runtime settings.

Defines ConfigurationError, raised when a component is configured
with settings that fall outside the allowed range or format (e.g.,
disallowed URL schemes, invalid filesystem paths, or out-of-range
parameters).

ConfigurationError

Bases: ValueErrorMixin, Error[MetadataValueType]

Raised when a component receives invalid configuration.

This error signals operational misconfiguration at runtime —
for example, a URL with a disallowed scheme, an invalid
filesystem path, or an out-of-range parameter value.

Example
error = ConfigurationError("Port must be between 1 and 65535, got 0")
raise error
Source code in src/forging_blocks/foundation/errors/configuration_error.py
class ConfigurationError(ValueErrorMixin, Error[MetadataValueType]):
    """Raised when a component receives invalid configuration.

    This error signals operational misconfiguration at runtime —
    for example, a URL with a disallowed scheme, an invalid
    filesystem path, or an out-of-range parameter value.

    Example:
        ```python
        error = ConfigurationError("Port must be between 1 and 65535, got 0")
        raise error
        ```
    """

    def __init__(self, message: str) -> None:
        """Initialise with a descriptive configuration-violation message.

        Args:
            message: Human-readable description of the misconfiguration,
                including the offending value and the acceptable range.

        """
        super().__init__(ErrorMessage(message))

__init__(message: str) -> None

Initialise with a descriptive configuration-violation message.

Parameters:

Name Type Description Default
message str

Human-readable description of the misconfiguration,
including the offending value and the acceptable range.

required
Source code in src/forging_blocks/foundation/errors/configuration_error.py
def __init__(self, message: str) -> None:
    """Initialise with a descriptive configuration-violation message.

    Args:
        message: Human-readable description of the misconfiguration,
            including the offending value and the acceptable range.

    """
    super().__init__(ErrorMessage(message))