From 8b4e8aff1c20dc40a98179dea5b9043877f9ff5f Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Fri, 26 Apr 2024 16:19:17 +0300 Subject: [PATCH] feat(agent): return more exceptions --- src/isolate/connections/grpc/agent.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/isolate/connections/grpc/agent.py b/src/isolate/connections/grpc/agent.py index 4dd0149..2455c86 100644 --- a/src/isolate/connections/grpc/agent.py +++ b/src/isolate/connections/grpc/agent.py @@ -101,18 +101,15 @@ def execute_function( ) -> Generator[definitions.PartialRunResult, None, Any]: if function.was_it_raised: raise AbortException( - f"The {function_kind} function must be callable, not a raised exception." + f"The `{function_kind}` function must be callable, not a raised exception." ) try: # TODO: technically any sort of exception could be raised here, since # depickling is basically involves code execution from the *user*. function = from_grpc(function) - except SerializationError: - yield from self.log(traceback.format_exc(), level=LogLevel.ERROR) - raise AbortException( - f"The {function_kind} function could not be deserialized." - ) + except SerializationError as exc: + return exc, True, traceback.format_exc() if not callable(function): raise AbortException(