BaseHTTPMiddleware: Exception displayed twice in logs #2715
-
|
Reproduction class MyMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request: Request, call_next) -> Response:
return await call_next(request)
def homepage(request): raise Exception("Very bad")
app = Starlette(routes=[Route("/", homepage)])
app.add_middleware(MyMiddleware) # No more problem if we remove this lineException is shown twice in the logs Full stack trace |
Beta Was this translation helpful? Give feedback.
Answered by
Kludex
Nov 3, 2025
Replies: 4 comments 2 replies
-
|
What's your Starlette version? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Starlette 0.38.6 |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Hi. Do you think I should create an issue for this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
This is solved. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kludex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is solved.