You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's about preventing raise anyio.ExceptionGroup in views under a BaseHTTPMiddleware. PR resolve that problem with nonlocal variable that stores our exception. But in the case of sub-applications, it does not work.
As I can see (fyi I am not good at asyncio), in the case below, we reach and read a response before we raise an exception and store it to our nonlocal variable:
Checklist
master
.Describe the bug
Let's start with this PR: #1262
It's about preventing raise
anyio.ExceptionGroup
in views under aBaseHTTPMiddleware
. PR resolve that problem with nonlocal variable that stores our exception. But in the case of sub-applications, it does not work.As I can see (fyi I am not good at asyncio), in the case below, we reach and read a response before we raise an exception and store it to our nonlocal variable:
fragment of
BaseHTTPMiddleware.__call__
in this moment:
except anyio.EndOfStream:
exception still no raised.Steps to reproduce the bug
Expected behavior
An exception was raised and caught by pytest exception
Actual behavior
An exception wasn't raised
Debugging material
No response
Environment
macOS Monterey 12.0.1, starlette 0.17.1, Python 3.9.9
Additional context
No response
The text was updated successfully, but these errors were encountered: