diff --git a/talkcorner/common/queue/nats/factory.py b/talkcorner/common/queue/nats/factory.py index fef477b..ba878e8 100644 --- a/talkcorner/common/queue/nats/factory.py +++ b/talkcorner/common/queue/nats/factory.py @@ -6,11 +6,11 @@ def nats_build_connection_uri( - *, - host: str, - port: int, - user: str, - password: str + *, + host: str, + port: int, + user: str, + password: str ) -> str: return f"nats://{user}:{password}@{host}:{port}" diff --git a/talkcorner/server/api/api_v1/exceptions/setup.py b/talkcorner/server/api/api_v1/exceptions/setup.py index 056cc3a..e405b40 100644 --- a/talkcorner/server/api/api_v1/exceptions/setup.py +++ b/talkcorner/server/api/api_v1/exceptions/setup.py @@ -48,7 +48,7 @@ ) -def register_exceptions(app: FastAPI) -> None: +def init_exceptions(app: FastAPI) -> None: app.add_exception_handler( NotValidateCredentialsError, not_validate_credentials_error_handler diff --git a/talkcorner/server/api/setup.py b/talkcorner/server/api/setup.py index 1507cdb..2ab4bd8 100644 --- a/talkcorner/server/api/setup.py +++ b/talkcorner/server/api/setup.py @@ -12,6 +12,7 @@ from talkcorner.server.api.api_v1.dependencies.security import CryptContextMarker from talkcorner.server.api.api_v1.dependencies.setting import SettingsMarker from talkcorner.server.api.api_v1.endpoints.setup import register_routers +from talkcorner.server.api.api_v1.exceptions.setup import init_exceptions from talkcorner.server.api.event import lifespan from talkcorner.server.database.factory import ( sa_create_engine, @@ -47,6 +48,7 @@ def register_app(settings: AppSettings) -> FastAPI: session_factory = sa_create_session_factory(engine=engine) app.include_router(router=register_routers(), prefix=settings.api_v1_str) + init_exceptions(app=app) app.dependency_overrides.update( {