updated login/select

This commit is contained in:
2025-01-27 21:43:36 +03:00
parent b88f910a43
commit c0bd9c1685
18 changed files with 257 additions and 275 deletions

View File

@@ -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)