Skip to content

Commit

Permalink
fix ASGI app running error message set
Browse files Browse the repository at this point in the history
  • Loading branch information
abersheeran committed Jun 26, 2024
1 parent 25f4d08 commit c3eaee7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions a2wsgi/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,18 @@ def asgi_done_callback(self, future: asyncio.Future) -> None:
pass
else:
if exception is not None:
self.sync_event.set(
{
"type": "a2wsgi.error",
"exception": (
type(exception),
exception,
exception.__traceback__,
),
}
task = asyncio.create_task(self.sync_event_set_lock.acquire())
task.add_done_callback(
lambda _: self.sync_event.set(
{
"type": "a2wsgi.error",
"exception": (
type(exception),
exception,
exception.__traceback__,
),
}
)
)
finally:
self.asgi_done.set()
Expand Down

0 comments on commit c3eaee7

Please sign in to comment.