| 74 | |
| 75 | |
| 76 | class HttpError(CustomHttpException): |
| 77 | def __init__( |
| 78 | self, |
| 79 | code: str, |
| 80 | detail: str, |
| 81 | status_code: int = status.HTTP_400_BAD_REQUEST, |
| 82 | errors: t.Optional[t.List["HttpError"]] = None, |
| 83 | ): |
| 84 | self.errors = errors |
| 85 | super().__init__(code=code or "generic_error", detail=detail, status_code=status_code) |
| 86 | |
| 87 | @property |
| 88 | def as_dict(self) -> dict: |
| 89 | return HttpErrorOut(code=self.code, errors=self.errors, detail=self.detail).dict() |
| 90 | |
| 91 | |
| 92 | class ValidationError(HttpError): |
no outgoing calls