yera.config.exceptions

Configuration exceptions.

Symbols

class ConfigError — A configuration file could not be read, written, or validated.
class ConfigReplacementError — The global configuration cannot be replaced in its current state.
class ConnectionConfigError — Raised when connection resolution or validation fails.
class ConnectionNotFoundInConfigError — Named connection is missing from the provider's connections.
class ConnectionNotSpecifiedError — The active Yera profile does not specify a connection for this provider.
class MCPConfigError — Raised when MCP server configuration or resolution fails.
class MCPInvalidConfigError — An MCP server declaration failed validation.
class MCPServerNotFoundInConfigError — An MCP connection selected by a profile is not configured.
class ModelInvalidConfigError — A model entry has invalid config.
class ModelNotFoundInConfigError — Named model is missing from yera.toml.
class ModelsConfigError — Raised when model config resolution or validation fails.
class ModelTypeNotFoundInConfigError — No default model is configured for a given type.
class ProfileConfigError — Raised when Yera profile config resolution or validation fails.
class ProfileInvalidConfigError — The profiles section failed Pydantic validation.
class ProfileNotFoundInConfigError — Named Yera profile is missing from ``yera.toml`` ``[profiles]``.
class ProfileNotSpecifiedError — No active Yera profile could be resolved.
class ProviderInvalidConfigError — A provider entry failed validation.
class ProviderNotFoundInConfigError — Named provider is missing from ``yera.toml``.
class ProvidersConfigError — Raised when provider config resolution or validation fails.
class ProvidersNotConfigured — The whole providers section is missing from yera.toml.
class PyprojectTomlNotFoundError — No ``pyproject.toml`` could be resolved for a project-scoped write.
class SettingsError — Raised when settings validation fails fatally.

ConfigError

Inherits: YeraError

A configuration file could not be read, written, or validated.

ConfigReplacementError

Inherits: ConfigError

The global configuration cannot be replaced in its current state.

Raised when replacement is requested for configuration that is missing or already valid.

Methods

__init__ — Build an error identifying the configuration state blocking replacement.

ConfigReplacementError.__init__

__init__(
    status: str,
) → None

Build an error identifying the configuration state blocking replacement.

Parameters

status
type: str

Current configuration status that prevents replacement.

ConnectionConfigError

Inherits: ConfigError

Raised when connection resolution or validation fails.

ConnectionNotFoundInConfigError

Named connection is missing from the provider's connections.

Methods

__init__ — Build an error listing alternatives to a missing connection.

ConnectionNotFoundInConfigError.__init__

__init__(
    provider_type: str,
    connection_name: str,
    available: list[str],
) → None

Build an error listing alternatives to a missing connection.

Parameters

provider_type
type: str

Provider containing the requested connection.

connection_name
type: str

Requested connection name.

available
type: list[str]

Connection names currently configured for the provider.

ConnectionNotSpecifiedError

The active Yera profile does not specify a connection for this provider.

Raised when a provider type is needed at runtime but the active Yera profile's provider map does not include an entry for it.

Methods

__init__ — Build an error identifying the profile with a missing provider mapping.

ConnectionNotSpecifiedError.__init__

__init__(
    provider_type: str,
    profile_name: str,
) → None

Build an error identifying the profile with a missing provider mapping.

Parameters

provider_type
type: str

Provider type required by the operation.

profile_name
type: str

Active profile that does not select a connection.

MCPConfigError

Inherits: ConfigError

Raised when MCP server configuration or resolution fails.

MCPInvalidConfigError

Inherits: MCPConfigError

An MCP server declaration failed validation.

Methods

__init__ — Build an error from MCP configuration validation details.

MCPInvalidConfigError.__init__

__init__(
    details: str,
) → None

Build an error from MCP configuration validation details.

Parameters

details
type: str

Validation details explaining why the configuration is invalid.

MCPServerNotFoundInConfigError

Inherits: MCPConfigError

An MCP connection selected by a profile is not configured.

Methods

__init__ — Build an error listing alternatives to a missing MCP server.

MCPServerNotFoundInConfigError.__init__

__init__(
    name: str,
    available: list[str],
) → None

Build an error listing alternatives to a missing MCP server.

Parameters

name
type: str

Requested MCP server connection name.

available
type: list[str]

MCP server connection names currently configured.

ModelInvalidConfigError

A model entry has invalid config.

Methods

__init__ — Build an error identifying an invalid model entry.

ModelInvalidConfigError.__init__

__init__(
    name: str,
    details: str,
) → None

Build an error identifying an invalid model entry.

Parameters

name
type: str

Name of the invalid model entry.

details
type: str

Validation details explaining why the entry is invalid.

ModelNotFoundInConfigError

Named model is missing from yera.toml.

Methods

__init__ — Build an error with optional suggestions for similar model IDs.

ModelNotFoundInConfigError.__init__

__init__(
    model_id: str,
    others: list[str] | None = None,
) → None

Build an error with optional suggestions for similar model IDs.

Parameters

model_id
type: str

Requested model identifier.

others
type: list[str] | None = None

Available identifiers to search for close matches.

ModelsConfigError

Inherits: ConfigError

Raised when model config resolution or validation fails.

ModelTypeNotFoundInConfigError

No default model is configured for a given type.

Methods

__init__ — Build an error identifying the model type without a default.

ModelTypeNotFoundInConfigError.__init__

__init__(
    model_type: str,
) → None

Build an error identifying the model type without a default.

Parameters

model_type
type: str

Model type for which no default is configured.

ProfileConfigError

Inherits: ConfigError

Raised when Yera profile config resolution or validation fails.

ProfileInvalidConfigError

The profiles section failed Pydantic validation.

Methods

__init__ — Build an error from profile validation details.

ProfileInvalidConfigError.__init__

__init__(
    details: str,
) → None

Build an error from profile validation details.

Parameters

details
type: str

Validation details explaining why the profile is invalid.

ProfileNotFoundInConfigError

Named Yera profile is missing from yera.toml [profiles].

Methods

__init__ — Build an error listing alternatives to a missing profile.

ProfileNotFoundInConfigError.__init__

__init__(
    name: str,
    available: list[str],
) → None

Build an error listing alternatives to a missing profile.

Parameters

name
type: str

Requested profile name.

available
type: list[str]

Profile names currently present in the configuration.

ProfileNotSpecifiedError

No active Yera profile could be resolved.

Raised when none of CLI flag, pyproject.toml, or yera.toml default yields a profile name.

Methods

__init__ — Build an error explaining how to select or create an active profile.

ProfileNotSpecifiedError.__init__

__init__() → None

Build an error explaining how to select or create an active profile.

ProviderInvalidConfigError

A provider entry failed validation.

Methods

__init__ — Build an error identifying an invalid provider entry.

ProviderInvalidConfigError.__init__

__init__(
    provider_type: str,
    details: str,
) → None

Build an error identifying an invalid provider entry.

Parameters

provider_type
type: str

Type of the invalid provider.

details
type: str

Validation details explaining why the entry is invalid.

ProviderNotFoundInConfigError

Named provider is missing from yera.toml.

Methods

__init__ — Build an error listing configured alternatives to a missing provider.

ProviderNotFoundInConfigError.__init__

__init__(
    provider_type: str,
    providers: Providers,
) → None

Build an error listing configured alternatives to a missing provider.

Parameters

provider_type
type: str

Requested provider type.

providers
type: Providers

Provider configuration used to list available types.

ProvidersConfigError

Inherits: ConfigError

Raised when provider config resolution or validation fails.

ProvidersNotConfigured

The whole providers section is missing from yera.toml.

Methods

__init__ — Build an error that appends guidance for configuring providers.

ProvidersNotConfigured.__init__

__init__(
    message: str,
) → None

Build an error that appends guidance for configuring providers.

Parameters

message
type: str

Context explaining why provider configuration was required.

PyprojectTomlNotFoundError

Inherits: ConfigError

No pyproject.toml could be resolved for a project-scoped write.

When message is omitted, default user-facing copy suggests creating pyproject.toml or writing to yera.toml instead.

Methods

__init__ — Build an error with an optional replacement for the default guidance.

PyprojectTomlNotFoundError.__init__

__init__(
    message: str | None = None,
) → None

Build an error with an optional replacement for the default guidance.

Parameters

message
type: str | None = None

User-facing explanation to use instead of the default.

SettingsError

Inherits: ConfigError

Raised when settings validation fails fatally.