From 042c78f3eee6a6eb936598742beb7a5e7b8268be Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Fri, 26 Apr 2024 21:00:14 +0300 Subject: [PATCH] feat(agent): return SerializationError instead of aborting (#121) --- src/isolate/connections/grpc/agent.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/isolate/connections/grpc/agent.py b/src/isolate/connections/grpc/agent.py index 4dd0149..dfe12a7 100644 --- a/src/isolate/connections/grpc/agent.py +++ b/src/isolate/connections/grpc/agent.py @@ -108,11 +108,8 @@ def execute_function( # 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(