yera.config.exceptions
Configuration exceptions.
Symbols
ConfigError
YeraErrorConfigReplacementError, ConnectionConfigError, MCPConfigError, ModelsConfigError, ProfileConfigError, ProvidersConfigError, PyprojectTomlNotFoundError, SettingsErrorA configuration file could not be read, written, or validated.
ConfigReplacementError
ConfigErrorThe global configuration cannot be replaced in its current state.
Raised when replacement is requested for configuration that is missing or already valid.
Methods
ConfigReplacementError.__init__
__init__(
status: str,
) → NoneBuild an error identifying the configuration state blocking replacement.
Parameters
Current configuration status that prevents replacement.
ConnectionNotFoundInConfigError
ConnectionConfigErrorNamed connection is missing from the provider's connections.
Methods
ConnectionNotFoundInConfigError.__init__
__init__(
provider_type: str,
connection_name: str,
available: list[str],
) → NoneBuild an error listing alternatives to a missing connection.
Parameters
Provider containing the requested connection.
Requested connection name.
Connection names currently configured for the provider.
ConnectionNotSpecifiedError
ConnectionConfigErrorThe 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
ConnectionNotSpecifiedError.__init__
__init__(
provider_type: str,
profile_name: str,
) → NoneBuild an error identifying the profile with a missing provider mapping.
Parameters
Provider type required by the operation.
Active profile that does not select a connection.
MCPInvalidConfigError
MCPConfigErrorAn MCP server declaration failed validation.
Methods
MCPInvalidConfigError.__init__
__init__(
details: str,
) → NoneBuild an error from MCP configuration validation details.
Parameters
Validation details explaining why the configuration is invalid.
MCPServerNotFoundInConfigError
MCPConfigErrorAn MCP connection selected by a profile is not configured.
Methods
MCPServerNotFoundInConfigError.__init__
__init__(
name: str,
available: list[str],
) → NoneBuild an error listing alternatives to a missing MCP server.
Parameters
Requested MCP server connection name.
MCP server connection names currently configured.
ModelInvalidConfigError
ModelsConfigErrorA model entry has invalid config.
Methods
ModelInvalidConfigError.__init__
__init__(
name: str,
details: str,
) → NoneBuild an error identifying an invalid model entry.
Parameters
Name of the invalid model entry.
Validation details explaining why the entry is invalid.
ModelNotFoundInConfigError
ModelsConfigErrorNamed model is missing from yera.toml.
Methods
ModelNotFoundInConfigError.__init__
__init__(
model_id: str,
others: list[str] | None = None,
) → NoneBuild an error with optional suggestions for similar model IDs.
Parameters
Requested model identifier.
Available identifiers to search for close matches.
ModelTypeNotFoundInConfigError
ModelsConfigErrorNo default model is configured for a given type.
Methods
ModelTypeNotFoundInConfigError.__init__
__init__(
model_type: str,
) → NoneBuild an error identifying the model type without a default.
Parameters
Model type for which no default is configured.
ProfileConfigError
ConfigErrorRaised when Yera profile config resolution or validation fails.
ProfileInvalidConfigError
ProfileConfigErrorThe profiles section failed Pydantic validation.
Methods
ProfileInvalidConfigError.__init__
__init__(
details: str,
) → NoneBuild an error from profile validation details.
Parameters
Validation details explaining why the profile is invalid.
ProfileNotFoundInConfigError
ProfileConfigErrorNamed Yera profile is missing from yera.toml [profiles].
Methods
ProfileNotFoundInConfigError.__init__
__init__(
name: str,
available: list[str],
) → NoneBuild an error listing alternatives to a missing profile.
Parameters
Requested profile name.
Profile names currently present in the configuration.
ProfileNotSpecifiedError
ProfileConfigErrorNo active Yera profile could be resolved.
Raised when none of CLI flag, pyproject.toml, or yera.toml default yields a profile name.
Methods
ProfileNotSpecifiedError.__init__
__init__() → NoneBuild an error explaining how to select or create an active profile.
ProviderInvalidConfigError
ProvidersConfigErrorA provider entry failed validation.
Methods
ProviderInvalidConfigError.__init__
__init__(
provider_type: str,
details: str,
) → NoneBuild an error identifying an invalid provider entry.
Parameters
Type of the invalid provider.
Validation details explaining why the entry is invalid.
ProviderNotFoundInConfigError
ProvidersConfigErrorNamed provider is missing from yera.toml.
Methods
ProviderNotFoundInConfigError.__init__
__init__(
provider_type: str,
providers: Providers,
) → NoneBuild an error listing configured alternatives to a missing provider.
Parameters
Requested provider type.
Provider configuration used to list available types.
ProvidersConfigError
ConfigErrorRaised when provider config resolution or validation fails.
ProvidersNotConfigured
ProvidersConfigErrorThe whole providers section is missing from yera.toml.
Methods
ProvidersNotConfigured.__init__
__init__(
message: str,
) → NoneBuild an error that appends guidance for configuring providers.
Parameters
Context explaining why provider configuration was required.
PyprojectTomlNotFoundError
ConfigErrorNo 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
PyprojectTomlNotFoundError.__init__
__init__(
message: str | None = None,
) → NoneBuild an error with an optional replacement for the default guidance.
Parameters
User-facing explanation to use instead of the default.