Download app/core/errors.py from raihan116/SeeMedAI: direct link, hf CLI and curl.
- Browser
- Download file 678 Bytes
-
https://huggingface.co/spaces/raihan116/SeeMedAI/resolve/main/app/core/errors.py
- Command line
-
hf download hf://spaces/raihan116/SeeMedAI/app/core/errors.py
-
curl -L -o errors.py https://huggingface.co/spaces/raihan116/SeeMedAI/resolve/main/app/core/errors.py
678 Bytes
| """Application errors. Each maps to an HTTP status and an error `code` in the API error schema (SRS §5.7).""" | |
| from __future__ import annotations | |
| class AppError(Exception): | |
| code = "internal" | |
| status = 500 | |
| class InvalidRequestError(AppError): | |
| code = "invalid_request" | |
| status = 400 | |
| class UnauthorizedError(AppError): | |
| code = "unauthorized" | |
| status = 401 | |
| class ForbiddenError(AppError): | |
| code = "forbidden" | |
| status = 403 | |
| class NotFoundError(AppError): | |
| code = "not_found" | |
| status = 404 | |
| class ConflictError(AppError): | |
| code = "conflict" | |
| status = 409 | |
| class RateLimitedError(AppError): | |
| code = "rate_limited" | |
| status = 429 | |