Fix for gen.throw(*sys.exc_info()) warning

Closes #2776
This commit is contained in:
Simon Willison 2026-06-13 11:15:47 -07:00
commit f2927a1647

View file

@ -829,10 +829,10 @@ def _apply_write_wrapper(fn, wrapper_factory, track_event):
# Execute the actual write
try:
result = fn(conn)
except Exception:
except Exception as e:
# Throw exception into generator so it can handle it
try:
gen.throw(*sys.exc_info())
gen.throw(e)
except StopIteration:
pass
# Re-raise the original exception