Skip to content

Commit

Permalink
more linter error fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitsharansatsangi committed Aug 17, 2022
1 parent 159c8ac commit 51b5453
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions piccolo_api/shared/middleware/junction.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import typing as t

from starlette.exceptions import HTTPException
from starlette.routing import Router
from starlette.types import Receive, Scope, Send
Expand All @@ -15,12 +17,14 @@ def __init__(self, *routers: Router) -> None:
async def __call__(self, scope: Scope, receive: Receive, send: Send):
for router in self.routers:
try:
asgi = await router(scope, receive=receive, send=send)
response: t.Any | None = await router(
scope, receive=receive, send=send
)
except HTTPException as exception:
if exception.status_code != 404:
raise exception
else:
if getattr(asgi, "status_code", None) == 404:
if getattr(response, "status_code", None) == 404:
continue
return

Expand Down

0 comments on commit 51b5453

Please sign in to comment.