mirror of
https://github.com/fastapi/fastapi.git
synced 2026-02-15 00:31:19 -05:00
* 📝 Update Release Notes with issue templates * ✨ Add HTTPException with support for headers Including docs and tests * 📝 Update Security docs to use new HTTPException
10 lines
322 B
Python
10 lines
322 B
Python
from starlette.exceptions import HTTPException as StarletteHTTPException
|
|
|
|
|
|
class HTTPException(StarletteHTTPException):
|
|
def __init__(
|
|
self, status_code: int, detail: str = None, headers: dict = None
|
|
) -> None:
|
|
super().__init__(status_code=status_code, detail=detail)
|
|
self.headers = headers
|