diff --git a/tractor/_exceptions.py b/tractor/_exceptions.py index efedcf0..7096912 100644 --- a/tractor/_exceptions.py +++ b/tractor/_exceptions.py @@ -55,12 +55,12 @@ def pack_error(exc): } -def unpack_error(msg, chan=None): +def unpack_error(msg, chan=None, err_type=RemoteActorError): """Unpack an 'error' message from the wire into a local ``RemoteActorError``. """ tb_str = msg['error'].get('tb_str', '') - return RemoteActorError( + return err_type( f"{chan.uid}\n" + tb_str, **msg['error'], )