Closed
Description
Long story short
I would like to use a pattern like:
try:
do_something()
except SomeException as e:
raise HTTPInternalServerError(reason='My message') from ewith cause information retained. Does it make sense to implement HTTPException.__bool__() to always True?
Expected behaviour
Two tracebacks separated by The above exception was the direct cause of the following exception:
Actual behaviour
The cause information is lost, because traceback.TracebackException evaluates the truthiness of the exception value to determine whether cause lines are produced. For HTTPException, truthiness is resolved via StreamResponse.__len__() which returns 0.