From 8e66f45e2386efacb344329a05c341343f9c0659 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 20 Mar 2024 11:36:39 -0400 Subject: [PATCH] Lul, don't overwrite 'tb_str' with src actor's.. This is what was breaking the nested debugger test (where it was failing on the traceback content matching) and it makes sense.. XD => We always want to use the locally boxed `RemoteActorError`'s traceback content NOT overwrite it with that from the src actor.. Also gets rid of setting the `'relay_uid'` since it's pulled from the final element in the `'relay_path'` anyway. --- tractor/_exceptions.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tractor/_exceptions.py b/tractor/_exceptions.py index b28a4a7..0e1d6d1 100644 --- a/tractor/_exceptions.py +++ b/tractor/_exceptions.py @@ -111,7 +111,6 @@ class RemoteActorError(Exception): reprol_fields: list[str] = [ 'src_uid', 'relay_path', - # 'relay_uid', ] def __init__( @@ -487,14 +486,11 @@ def pack_error( else: tb_str = traceback.format_exc() - our_uid: tuple = current_actor().uid - error_msg: dict[ + error_msg: dict[ # for IPC str, str | tuple[str, str] - ] = { - 'tb_str': tb_str, - 'relay_uid': our_uid, - } + ] = {} + our_uid: tuple = current_actor().uid if ( isinstance(exc, RemoteActorError) @@ -535,6 +531,11 @@ def pack_error( [], ).append(our_uid) + # XXX NOTE: always ensure the traceback-str is from the + # locally raised error (**not** the prior relay's boxed + # content's `.msgdata`). + error_msg['tb_str'] = tb_str + pkt: dict = {'error': error_msg} if cid: pkt['cid'] = cid