From a9932e6c01fa8b9ff23103e47e42911f4a24fead Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 12 Jan 2019 13:26:02 -0500 Subject: [PATCH] Allow passing error type to `unpack_error()` --- tractor/_exceptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'], )