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.
MessageTooLargeError
¶
Bases: ExchangeError
Message payload is too large for exchange.
If encountering this error, consider using the
ProxyStoreExchangeTransport
class an way to by-pass the exchange for large data.
Source code in academy/exception.py
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.
ExchangeClientNotFoundError
¶
Bases: Exception
Handle to agent can not find an exchange client to use.
A Handle
is
initialized with a target agent ID is not used in a context where an
exchange client could be inferred. Typically this can be resolved by
using a ExchangeClient
or
Manager
as a context manager. If this error
happens within an agent, it likely means the agent was not started.
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.