middleware hides errors from background tasks #11828
Unanswered
varun-seth
asked this question in
Questions
Replies: 1 comment
-
When using Try using import logging
def task1():
try:
# Simulated error
raise ValueError("Task 1 failed")
except Exception as e:
logging.error(f"Error in background task: {e}") |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
When the middleware is added, the errors from background tasks are not logged.
Operating System
macOS
Operating System Details
No response
FastAPI Version
0.111.0
Pydantic Version
1.10.13
Python Version
3.11.6
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions