Commit dd3de36
committed
Just re-raise the original exception, as-is
In Python `raise … from None` is an explicit request to raise the
exception but to suppress any exception chaining. (See:
https://docs.python.org/3/tutorial/errors.html#exception-chaining)
This means that if, when an ASGI exception crashes, an exception causes
another exception, that when the second exception (which has the first
chained to it) reaches this point in the stack, these lines will
re-raise it, but remove the chained exception. This can be confusing:
ASGI frameworks will normally log a stack trace of the crashing
application, but that stack trace will now be truncated, due to this
`from None` removing the chained exception.
The chained exception (which is the exception that kicked off the entire
stack unwind) is usually the more interesting one, when you're
debugging.
Neither of the two changed lines seem to have a reason for `… from
None`. Additionally, since they just re-raise the original exception,
simply "`raise`" suffices.
Fixes: #56241 parent adcd90c commit dd3de36
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| |||
0 commit comments