Use `'<unknown>'` for unresolvable `.boxed_type_str`

Add a teensie unit test to match.

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
multicast_revertable_streams
Gud Boi 2026-03-24 16:45:24 -04:00
parent 80597b80bf
commit 5968a3c773
2 changed files with 11 additions and 1 deletions

View File

@ -165,6 +165,16 @@ class TestRegErrTypesPlumbing:
is tractor.ContextCancelled
)
def test_boxed_type_str_without_ipc_msg(self):
'''
When a `RemoteActorError` is constructed
without an IPC msg (and no resolvable type),
`.boxed_type_str` should return `'<unknown>'`.
'''
rae = RemoteActorError('test')
assert rae.boxed_type_str == '<unknown>'
# -- IPC-level integration tests --

View File

@ -491,7 +491,7 @@ class RemoteActorError(Exception):
if self._ipc_msg:
return self._ipc_msg.boxed_type_str
return ''
return '<unknown>'
@property
def boxed_type(self) -> Type[BaseException]: