Skip to content

Commit ccd4f03

Browse files
committed
FIX: Function handler to return False
Following my request changes in #4463, it seems that the pyaedt_function_handler function was not working correctly. Indeed, if an exception was raised and the settings were such that one would want the function handler to return False, no value was returned by the function (leading to a None return).
1 parent fa00714 commit ccd4f03

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pyaedt/generic/general_methods.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def _check_types(arg):
181181
return ""
182182

183183

184-
def raise_exception(e):
184+
def raise_exception_or_return_false(e):
185185
if not settings.enable_error_handler:
186186
if settings.release_on_exception:
187187
from pyaedt.generic.desktop_sessions import _desktop_sessions
@@ -216,13 +216,13 @@ def wrapper(*args, **kwargs):
216216
pyaedt_logger.error("")
217217
if settings.enable_file_logs:
218218
settings.error(message)
219-
raise_exception(e)
219+
return raise_exception_or_return_false(e)
220220
except GrpcApiError as e:
221221
_exception(sys.exc_info(), user_function, args, kwargs, "AEDT grpc API call Error")
222-
raise_exception(e)
222+
return raise_exception_or_return_false(e)
223223
except BaseException as e:
224224
_exception(sys.exc_info(), user_function, args, kwargs, str(sys.exc_info()[1]).capitalize())
225-
raise_exception(e)
225+
return raise_exception_or_return_false(e)
226226

227227
return wrapper
228228

0 commit comments

Comments
 (0)