Bug: ASGIApp's with custom exception handlers result in Litestar throwing AttributeError
when an exception occurs within the ASGI APP
#3934
Labels
area/exceptions
area/middleware
This PR involves changes to the middleware
Bug 🐛
This is something that is not working as expected
Description
If an ASGI App mounted using
@asgi("/", is_mount=True)
defines a custom exception handler, litestar will throw anAttributeError
from thelitestar/middleware/_internal/exceptions/middleware.py
file when said ASGI App raises an exception.It looks like the file takes
app: ASGIApp
but the middleware exception handling attempts to possibly treat it likeapp: Litestar
. One way I have found which resolves this (and possibly introduces unintended side effects) is as follows:URL to code causing the issue
No response
MCVE
Steps to reproduce
1. Run the MCVE 2. Navigate to the site and observe the `AttributeError` being thrown by Litestar
Screenshots
No response
Logs
Litestar Version
Platform
The text was updated successfully, but these errors were encountered: