updated login/select
This commit is contained in:
@@ -9,8 +9,13 @@ This module contains all the handler functions for configuring and setting up th
|
||||
|
||||
from fastapi import FastAPI, Request, status
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from pydantic import ValidationError
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
from ApiLayers.ErrorHandlers.ErrorHandlers.api_exc_handler import (
|
||||
HTTPExceptionApiHandler,
|
||||
validation_exception_handler,
|
||||
)
|
||||
from ApiLayers.ErrorHandlers.Exceptions.api_exc import HTTPExceptionApi
|
||||
from ApiLayers.Middleware.auth_middleware import (
|
||||
RequestTimingMiddleware,
|
||||
@@ -58,14 +63,9 @@ def setup_exception_handlers(app: FastAPI) -> None:
|
||||
Args:
|
||||
app: FastAPI application instance
|
||||
"""
|
||||
from ApiLayers.ErrorHandlers.ErrorHandlers.api_exc_handler import (
|
||||
HTTPExceptionApiHandler,
|
||||
)
|
||||
|
||||
custom_exception_handler = HTTPExceptionApiHandler(response_model=JSONResponse)
|
||||
app.add_exception_handler(
|
||||
HTTPExceptionApi, custom_exception_handler.handle_exception
|
||||
)
|
||||
app.add_exception_handler(ValidationError, validation_exception_handler)
|
||||
app.add_exception_handler(HTTPExceptionApi, custom_exception_handler.handle_exception)
|
||||
app.add_exception_handler(Exception, generic_exception_handler)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user