2019-05-30 19:43:02 +04:00
|
|
|
from typing import Any
|
|
|
|
|
|
2019-05-29 16:27:55 +04:00
|
|
|
from pydantic import ValidationError
|
2019-02-16 17:01:29 +04:00
|
|
|
from starlette.exceptions import HTTPException as StarletteHTTPException
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class HTTPException(StarletteHTTPException):
|
|
|
|
|
def __init__(
|
2019-05-30 19:43:02 +04:00
|
|
|
self, status_code: int, detail: Any = None, headers: dict = None
|
2019-02-16 17:01:29 +04:00
|
|
|
) -> None:
|
|
|
|
|
super().__init__(status_code=status_code, detail=detail)
|
|
|
|
|
self.headers = headers
|
2019-05-29 16:27:55 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class RequestValidationError(ValidationError):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class WebSocketRequestValidationError(ValidationError):
|
|
|
|
|
pass
|