17 lines
333 B
Python
17 lines
333 B
Python
from pydantic import BaseModel
|
|
|
|
|
|
class ErrorData(BaseModel):
|
|
error_code: int
|
|
error_text: str
|
|
|
|
|
|
class Response[T](BaseModel):
|
|
error: bool = False
|
|
response: T | ErrorData
|
|
|
|
|
|
# Constants
|
|
NOT_FOUND = ErrorData(error_code=1, error_text='Not Found')
|
|
VALIDATION_ERROR = ErrorData(error_code=2, error_text='Validation Error')
|