Skip to content

Commit

Permalink
missed initial exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
novichikhin committed Sep 12, 2023
1 parent 1c3c2a3 commit 651d3e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions talkcorner/common/queue/nats/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
2 changes: 1 addition & 1 deletion talkcorner/server/api/api_v1/exceptions/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions talkcorner/server/api/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
{
Expand Down

0 comments on commit 651d3e0

Please sign in to comment.