From 1db5d4def29ff8715cafaf1788e9951ced300c5e Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 30 May 2024 09:14:04 -0400 Subject: [PATCH] Add `Error.message: str` Allows passing a custom error msg other then the traceback-str over the wire. Make `.tb_str` optional (in the blank `''` sense) since it's treated that way thus far in `._exceptions.pack_error()`. --- tractor/msg/types.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tractor/msg/types.py b/tractor/msg/types.py index 08511ec..ad6d6fb 100644 --- a/tractor/msg/types.py +++ b/tractor/msg/types.py @@ -410,7 +410,13 @@ class Error( src_type_str: str boxed_type_str: str relay_path: list[tuple[str, str]] - tb_str: str + + # normally either both are provided or just + # a message for certain special cases where + # we pack a message for a locally raised + # mte or ctxc. + message: str|None = None + tb_str: str = '' # TODO: only optionally include sub-type specfic fields? # -[ ] use UNSET or don't include them via `omit_defaults` (see