starlette-prometheus icon indicating copy to clipboard operation
starlette-prometheus copied to clipboard

Don't suppress exception chain

Open JoseKilo opened this issue 1 year ago • 0 comments

This line from the middleware makes sure that exceptions are re-raised after counting them:

https://github.com/perdy/starlette-prometheus/blob/master/starlette_prometheus/middleware.py#L57

But the from None part is removing any existing chain from the original exception.

This is really unexpected, since the logging behaviour changes after adding the middleware.

I don't see a reason to suppress the chain, was there a reason at some point ?

JoseKilo avatar May 20 '24 15:05 JoseKilo