Spaces:
Sleeping
Sleeping
Download src/autodata_agent/core/errors.py from LostDecimal/adaa-agent-backend: direct link, hf CLI and curl.
- Browser
- Download file 660 Bytes
-
https://huggingface.co/spaces/LostDecimal/adaa-agent-backend/resolve/main/src/autodata_agent/core/errors.py
- Command line
-
hf download hf://spaces/LostDecimal/adaa-agent-backend/src/autodata_agent/core/errors.py
-
curl -L -o errors.py https://huggingface.co/spaces/LostDecimal/adaa-agent-backend/resolve/main/src/autodata_agent/core/errors.py
660 Bytes
| from __future__ import annotations | |
| from typing import Any | |
| class AppError(Exception): | |
| """Structured application error that can be safely returned through the API.""" | |
| def __init__( | |
| self, | |
| code: str, | |
| message: str, | |
| *, | |
| status_code: int = 400, | |
| details: dict[str, Any] | None = None, | |
| ) -> None: | |
| super().__init__(message) | |
| self.code = code | |
| self.message = message | |
| self.status_code = status_code | |
| self.details = details or {} | |
| class ExternalServiceError(AppError): | |
| pass | |
| class ValidationAppError(AppError): | |
| pass | |
| class ExecutionAppError(AppError): | |
| pass | |