Skip to content

Commit 9eabf92

Browse files
committed
adding hooks for databases
1 parent a984861 commit 9eabf92

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

wolframclient/language/decorators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
def safe_wl_execute(
19-
function, args=(), opts={}, export_opts={}, exception_class=WolframLanguageException
19+
function, args=(), opts={}, export_opts={}, exception_class=None
2020
):
2121

2222
__traceback_hidden_variables__ = True
@@ -37,7 +37,7 @@ def safe_wl_execute(
3737
except Exception:
3838
pass
3939

40-
if exception_class is WolframLanguageException:
40+
if not exception_class or exception_class is WolframLanguageException:
4141
return export(
4242
WolframLanguageException(export_exception, exec_info=sys.exc_info()),
4343
**export_opts
@@ -84,7 +84,7 @@ def safe_wl_execute(
8484
]
8585

8686

87-
def to_wl(exception_class=WolframLanguageException, **export_opts):
87+
def to_wl(exception_class=None, **export_opts):
8888
def outer(function):
8989
@wraps(function)
9090
def inner(*args, **opts):

wolframclient/utils/externalevaluate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,12 @@ def start_zmq_loop(
188188
redirect_stdout=True,
189189
export_kwargs=EXPORT_KWARGS,
190190
evaluate_message=evaluate_message,
191+
exception_class=None,
191192
consumer=None,
192193
**opts
193194
):
194195

195-
handler = to_wl(**export_kwargs)(handle_message)
196+
handler = to_wl(exception_class=exception_class, **export_kwargs)(handle_message)
196197

197198
socket = start_zmq_instance(**opts)
198199

0 commit comments

Comments
 (0)