Skip to content

Commit cbbad4e

Browse files
actually we do need to recreate the exception
1 parent 0d30aed commit cbbad4e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/noob/network/message.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ class AnnounceValue(TypedDict):
8888

8989

9090
class ErrorValue(TypedDict):
91-
err: Exception
91+
err_type: type[Exception]
92+
err_args: tuple
9293
traceback: TracebackException
9394

9495

src/noob/runner/zmq.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,8 @@ def error(self, err: Exception) -> None:
574574
msg = ErrorMsg(
575575
node_id=self.spec.id,
576576
value=ErrorValue(
577-
err=err,
577+
err_type=type(err),
578+
err_args=err.args,
578579
traceback=tbexception,
579580
),
580581
)
@@ -733,7 +734,7 @@ def _throw_error(self) -> None:
733734

734735
# add the traceback as a note,
735736
# sort of the best we can do without using tblib
736-
err = errval["err"]
737+
err = errval["err_type"](*errval["err_args"])
737738
tb_message = "\nError re-raised from node runner process\n\n"
738739
tb_message += "Original traceback:\n"
739740
tb_message += "-" * 20 + "\n"

0 commit comments

Comments
 (0)