Spaces:
Runtime error
Runtime error
File size: 582 Bytes
04a921d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | """Error response schemas for API."""
from typing import Optional
from pydantic import BaseModel
class ErrorResponse(BaseModel):
"""Standard error response schema."""
code: str
message: str
details: Optional[dict[str, str]] = None
class ErrorCode:
"""Error code constants."""
VALIDATION_ERROR = "VALIDATION_ERROR"
UNAUTHORIZED = "UNAUTHORIZED"
FORBIDDEN = "FORBIDDEN"
NOT_FOUND = "NOT_FOUND"
CONFLICT = "CONFLICT"
EMAIL_EXISTS = "EMAIL_EXISTS"
INVALID_CREDENTIALS = "INVALID_CREDENTIALS"
INTERNAL_ERROR = "INTERNAL_ERROR"
|