forked from goodboy/tractor
1
0
Fork 0

Hide `_invoke()` tb, move actor error to exceptions mod

ctx_debugger
Tyler Goodlet 2021-07-31 13:56:26 -04:00
parent 0afa7f0f8e
commit 6006adc0de
3 changed files with 12 additions and 8 deletions

View File

@ -41,10 +41,6 @@ from . import _mp_fixup_main
log = get_logger('tractor')
class ActorFailure(Exception):
"General actor failure"
async def _invoke(
actor: 'Actor',
@ -56,8 +52,10 @@ async def _invoke(
Union[trio.CancelScope, BaseException]
] = trio.TASK_STATUS_IGNORED,
):
"""Invoke local func and deliver result(s) over provided channel.
"""
'''Invoke local func and deliver result(s) over provided channel.
'''
__tracebackhide__ = True
treat_as_gen = False
# possible a traceback (not sure what typing is for this..)

View File

@ -12,6 +12,10 @@ import trio
_this_mod = importlib.import_module(__name__)
class ActorFailure(Exception):
"General actor failure"
class RemoteActorError(Exception):
# TODO: local recontruction of remote exception deats
"Remote actor exception bundled locally"
@ -40,6 +44,7 @@ class InternalActorError(RemoteActorError):
class TransportClosed(trio.ClosedResourceError):
"Underlying channel transport was closed prior to use"
class ContextCancelled(RemoteActorError):
"Inter-actor task context cancelled itself on the callee side."
@ -58,7 +63,7 @@ class NoRuntime(RuntimeError):
def pack_error(
exc: BaseException,
tb = None,
tb=None,
) -> Dict[str, Any]:
"""Create an "error message" for tranmission over

View File

@ -29,8 +29,9 @@ from ._state import (
from .log import get_logger
from ._portal import Portal
from ._actor import Actor, ActorFailure
from ._actor import Actor
from ._entry import _mp_main
from ._exceptions import ActorFailure
log = get_logger('tractor')