Avoid attr-err when `._ipc_msg==None`
Seems this can happen in particular when we raise a `MessageTypeError` on the sender side of a `Context`, since there isn't any msg relayed from the other side (though i'm wondering if MTE should derive from RAE then considering this case?). Means `RemoteActorError.boxed_type = None` in such cases instead of raising an attr-error for the `None.boxed_type_str`.
parent
7aec0fdfa4
commit
721461298d
|
@ -432,9 +432,13 @@ class RemoteActorError(Exception):
|
||||||
Error type boxed by last actor IPC hop.
|
Error type boxed by last actor IPC hop.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
if self._boxed_type is None:
|
if (
|
||||||
|
self._boxed_type is None
|
||||||
|
and
|
||||||
|
(ipc_msg := self._ipc_msg)
|
||||||
|
):
|
||||||
self._boxed_type = get_err_type(
|
self._boxed_type = get_err_type(
|
||||||
self._ipc_msg.boxed_type_str
|
ipc_msg.boxed_type_str
|
||||||
)
|
)
|
||||||
|
|
||||||
return self._boxed_type
|
return self._boxed_type
|
||||||
|
@ -1144,6 +1148,12 @@ def unpack_error(
|
||||||
|
|
||||||
'''
|
'''
|
||||||
if not isinstance(msg, Error):
|
if not isinstance(msg, Error):
|
||||||
|
# log.critical(
|
||||||
|
# f'Why a non-Error !?\n'
|
||||||
|
# f'{msg}\n'
|
||||||
|
# )
|
||||||
|
# dun work without gb-portal!
|
||||||
|
# breakpoint()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# try to lookup a suitable error type from the local runtime
|
# try to lookup a suitable error type from the local runtime
|
||||||
|
|
Loading…
Reference in New Issue