academy.exception¶
ActionCancelledError
¶
ActionInvalidStateError
¶
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
PingCancelledError
¶
Bases: Exception
Ping cancelled before response.
This error is typically raised when an agent receives a message before startup, then exits while starting.
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 bypass 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
DeserializationMethodProhibitedError
¶
Bases: Exception
Deserialization prohibited.
Request argument or results are serialized using a method that is prohibtted from being deserialized in the current context.
ExceptionSerializationError
¶
Bases: Exception
Error when serializing an exception.
An action attempted to return an exception, but that exception could not be serialized using the method provided.
Source code in academy/exception.py
AcademyRemoteError
¶
Bases: Exception
Generalized exception for serializing remote exceptions.
Any exception raised that is JSON serialized loses its type.
To raise the original exception, change exception_serialization in the
action invocation.
IncompatibleNetworkProtocolError
¶
Bases: Exception
Received message incompatible with this version.
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.