SwashBuckler001's picture
IdiomBench (part 9)
acb7111 verified
Raw History Blame Contribute Delete
242 Bytes
@contextlib.contextmanager
def add_exc_note(note: str):
try:
yield
except Exception as err:
err.add_note(note)
raise
with add_exc_note(f"While attempting to frobnicate {item=}"):
frobnicate_or_raise(item)