Grade 4
This commit is contained in:
+4
-1
@@ -5,6 +5,7 @@ from contextlib import asynccontextmanager
|
||||
from sqlalchemy.exc import OperationalError, InterfaceError, TimeoutError as PoolTimeout
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from redis.exceptions import RedisError
|
||||
from botocore.exceptions import BotoCoreError, ClientError
|
||||
|
||||
from .errors import APIError, api_error_handler, validation_error_handler, http_error_handler, internal_error_handler, dependency_error_handler
|
||||
from .database import create_db_engine
|
||||
@@ -16,6 +17,7 @@ from .routers.health import router as health_router
|
||||
from .routers.users import router as users_router
|
||||
from .routers.chats import router as chats_router
|
||||
from .routers.auth import router as auth_router
|
||||
from .routers.attachments import router as attachments_router
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
@@ -36,10 +38,11 @@ app.add_exception_handler(APIError, api_error_handler)
|
||||
app.add_exception_handler(RequestValidationError, validation_error_handler)
|
||||
app.add_exception_handler(HTTPException, http_error_handler)
|
||||
app.add_exception_handler(Exception, internal_error_handler)
|
||||
for error in (OperationalError, InterfaceError, PoolTimeout, RedisError):
|
||||
for error in (OperationalError, InterfaceError, PoolTimeout, RedisError, BotoCoreError, ClientError):
|
||||
app.add_exception_handler(error, dependency_error_handler)
|
||||
|
||||
app.include_router(health_router)
|
||||
app.include_router(users_router)
|
||||
app.include_router(chats_router)
|
||||
app.include_router(auth_router)
|
||||
app.include_router(attachments_router)
|
||||
|
||||
Reference in New Issue
Block a user