Skip to content

Commit

Permalink
refactor(litestar): make after_exception function private
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirVondukr committed Nov 21, 2024
1 parent 86b0650 commit c43914f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aioinject/ext/litestar.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def __call__(
await self.app(scope, receive, send)


async def after_exception(exception: BaseException, scope: Scope) -> None:
async def _after_exception(exception: BaseException, scope: Scope) -> None:
if _SCOPE_CONTEXT_KEY in scope:
await scope[_SCOPE_CONTEXT_KEY].__aexit__( # type: ignore[literal-required]
type(exception),
Expand All @@ -76,5 +76,5 @@ def on_app_init(self, app_config: AppConfig) -> AppConfig:
app_config.state[_STATE_KEY] = self.container
app_config.middleware.append(AioInjectMiddleware)
app_config.lifespan.append(self._lifespan)
app_config.after_exception.append(after_exception)
app_config.after_exception.append(_after_exception)
return app_config

0 comments on commit c43914f

Please sign in to comment.