Skip to content

Commit

Permalink
feat(agent): return more exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
efiop committed Apr 26, 2024
1 parent 3b13546 commit 8b4e8af
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/isolate/connections/grpc/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 8b4e8af

Please sign in to comment.