base_service
Base service module
Classes
BaseService
ResponseCode
Bases: Enum
Service-layer response codes.
Attributes
ServiceError
ServiceError(
msg: Optional[str] = None,
code: ResponseCode = GENERAL_SERVICE_ERROR,
trace_id: Optional[str] = None,
)
Bases: Exception
Custom exception class for service execution errors.
ServiceError
is used throughout the service layer to standardize error handling and reporting. It provides
structured information about the error, including a numeric error code, a human-readable description, and a unique
trace identifier for better error tracking and client support. Moreover this mechanism prevents the need to pass
raw exception details back to the client, which could expose sensitive information or unwanted implementation details.