academy.exception¶
ActionCancelledError
¶
ActionCancelledError(name: str)
Bases: Exception
Action was cancelled by the agent.
This often happens when an agent is shutdown mid-action execution and configured to cancel running actions.
Source code in academy/exception.py
AgentNotInitializedError
¶
Bases: Exception
Agent runtime context has not been initialized.
This error is typically raised when accessing the runtime context for an agent before the agent has been executed.
Source code in academy/exception.py
BadEntityIdError
¶
BadEntityIdError(uid: EntityId)
Bases: ExchangeError
Entity associated with the identifier is unknown.
Source code in academy/exception.py
ForbiddenError
¶
Bases: ExchangeError
Exchange client does not have permission to access resources.
MailboxTerminatedError
¶
MailboxTerminatedError(uid: EntityId)
Bases: ExchangeError
Entity mailbox is terminated and cannot send or receive messages.
Constructing this error type implicitly returns one of the derived types,
AgentTerminatedError
or
UserTerminatedError
, based
on the entity type.
Source code in academy/exception.py
AgentTerminatedError
¶
Bases: MailboxTerminatedError
Agent mailbox is terminated and cannot send or receive messages.
Source code in academy/exception.py
UserTerminatedError
¶
UserTerminatedError(uid: UserId)
Bases: MailboxTerminatedError
User mailbox is terminated and cannot send or receive messages.
Source code in academy/exception.py
UnauthorizedError
¶
Bases: ExchangeError
Exchange client has not provided valid authentication credentials.
HandleClosedError
¶
HandleNotBoundError
¶
Bases: Exception
Handle to agent is in an unbound state.
An UnboundRemoteHandle
is
initialized with a target agent ID, but is not attached to an exchange
client that the handle can use for communication.
An unbound handle can be turned into a usable handle by binding it to
an exchange client with
UnboundRemoteHandle.bind_to_client()
.
Source code in academy/exception.py
raise_exceptions
¶
raise_exceptions(
exceptions: Iterable[BaseException],
*,
message: str | None = None
) -> None
Raise exceptions as a group.
Raises a set of exceptions as an ExceptionGroup
in Python 3.11 and later. If only one exception is provided, it is raised
directly. In Python 3.10 and older, only one exception is raised.
This is a no-op if the size of exceptions
is zero.
Parameters:
-
exceptions
(Iterable[BaseException]
) –An iterable of exceptions to raise.
-
message
(str | None
, default:None
) –Custom error message for the exception group.