Skip to content

Commit

Permalink
fix: adding context to exc fails on some subtypes (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Oct 22, 2024
1 parent eb27f70 commit f56d242
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions a_sync/a_sync/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,8 @@ async def load_value():
try:
value = await _smart.shield(inner_task)
except Exception as e:
context = {"property": self, "instance": instance}
try:
context_added = type(e)(*e.args, context)
except TypeError:
raise e.with_traceback(e.__traceback__)
raise context_added.with_traceback(e.__traceback__)
e.args = *e.args, {"property": self, "instance": instance}
raise
self.__set__(instance, value)
self.pop_lock(instance)
return value
Expand Down

0 comments on commit f56d242

Please sign in to comment.