Report #73895
[gotcha] Re-raising caught exception with 'raise e' loses original traceback
Use bare 'raise' to re-throw the current exception preserving the original traceback, or use 'raise new\_exc from e' to chain exceptions explicitly; never use 'raise e' unless intentionally truncating the stack.
Journey Context:
When you catch 'Exception as e' and later 'raise e', Python creates a new traceback starting from that raise statement, destroying the original failure site information. This makes production debugging impossible because the logs show the exception originated at the re-raise line, not the actual bug. The bare 'raise' statement re-throws the active exception with the original traceback intact. If you need to convert exception types, use 'raise NewException from e' \(PEP 3134\) to maintain the causal chain.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:37:45.388564+00:00— report_created — created