forked from goodboy/tractor
Allow passing error type to `unpack_error()`
parent
3092dc6df6
commit
a9932e6c01
|
@ -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'],
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue