alexschimpf / fastapi-versionizer

FastAPI Versionizer
MIT License
81 stars 13 forks source link

When both versionize and middleware are used exception stack traces are not printed #4

Closed adg-mh closed 1 year ago

adg-mh commented 1 year ago

Using the example below, exceptions are not printed when both versionize and app.middleware are used. If you comment either versionize or app.middleware sections, stack traces are printed.

Example code ```python from fastapi import FastAPI, Response, Request from fastapi_versionizer.versionizer import versionize app = FastAPI(title="My Versioned API") @app.middleware("http") async def test_middleware(request: Request, call_next): response: Response = await call_next(request) return response @app.get("/do_something") async def do_something(): 1 / 0 return Response(content="response") versions = versionize( app=app, prefix_format='/v{major}', docs_url='/docs', redoc_url='/redoc' ) ```
alexschimpf commented 1 year ago

This issue was raised before: https://github.com/alexschimpf/fastapi-versionizer/issues/1

Does that help?

adg-mh commented 1 year ago

Yes, it does. Absolutely can't believe I missed that given it was 1 of only 3 existing issues. Sorry for the noise and thank you for the quick reply.