Skip to content

Commit 7abb338

Browse files
committed
remove try-finally for return, which was swallowing error
1 parent 6c0cc99 commit 7abb338

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

aikido_zen/sinks/__init__.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,6 @@ def decorator(func, instance, args, kwargs):
5555
return decorator
5656

5757

58-
def before_modify_return(wrapper):
59-
"""
60-
Surrounds a patch with try-except and calls the original function at the end unless a return value is present.
61-
"""
62-
63-
def decorator(func, instance, args, kwargs):
64-
try:
65-
rv = wrapper(func, instance, args, kwargs) # Call the patch
66-
if rv is not None:
67-
return rv
68-
except AikidoException as e:
69-
raise e # Re-raise AikidoException
70-
except Exception as e:
71-
logger.debug(
72-
"%s:%s wrapping-before error: %s", func.__module__, func.__name__, e
73-
)
74-
return func(*args, **kwargs) # Call the original function
75-
76-
return decorator
77-
78-
7958
def before_async(wrapper):
8059
"""
8160
Surrounds an async patch with try-except and calls the original asynchronous function at the end

0 commit comments

Comments
 (0)