Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gracefully hanlde exceptions that happen after successful request.
With the current implementation, any exception in the ASGI app will make mangum return a response with 500, even though the application may have already correctly generated a valid response. In those cases we want to return the valid response and log the error, rather than fail. One example where this would manifest: failures in BackgroundTasks in FastAPI. This makes it inline with running FastAPI (and other ASGI) applications standalone where failures in the background tasks will return not make the whole request fail.
- Loading branch information