domain.errors.provider_connection_error¶
src.domain.errors.provider_connection_error
¶
Provider connection domain errors.
Defines provider connection-specific error constants for state transitions, validation, and connection management.
Architecture
- Domain layer errors (no infrastructure dependencies)
- Used in Result types (railway-oriented programming)
- Never raised as exceptions (return Failure(error) instead)
Usage
from src.domain.errors import ProviderConnectionError from src.core.result import Failure
result = connection.mark_connected(credentials) match result: case Success(_): # Connection activated ... case Failure(ProviderConnectionError.INVALID_STATE_TRANSITION): # Handle invalid transition ...
Reference
- docs/architecture/provider-domain-model.md
Classes¶
ProviderConnectionError
¶
Provider connection error constants.
Used in Result types for connection operation failures. These are NOT exceptions - they are error value constants used in railway-oriented programming pattern.
Error Categories
- State transition errors: INVALID_STATE_TRANSITION
- Validation errors: INVALID_CREDENTIALS, INVALID_PROVIDER_SLUG
- Status errors: NOT_CONNECTED, CREDENTIALS_EXPIRED