Skip to content

Commit

Permalink
Chain all AttributeErrors for better traceback
Browse files Browse the repository at this point in the history
  • Loading branch information
samamorgan committed Oct 27, 2023
1 parent e4eefb3 commit b451953
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions welkin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,11 @@ def wrapper(self, *args, **kwargs) -> Callable:
if not args and key not in kwargs:
try:
kwargs[key] = find_model_id(self, model)
except AttributeError as exc:
outer_exc = exc
except AttributeError as e:
try:
raise e from outer_exc
except AttributeError as exc:
outer_exc = exc

try:
return f(self, *args, **kwargs)
Expand Down

0 comments on commit b451953

Please sign in to comment.