asException
Converts the current AgentServiceError
instance into a corresponding AgentEngineException
instance.
This function maps the type
property of the AgentServiceError
to a specific subclass of AgentEngineException
based on the error type. Each error type corresponds to a specific exception:
UNEXPECTED_ERROR
maps toUnexpectedServerException
.UNEXPECTED_MESSAGE_TYPE
maps toUnexpectedMessageTypeException
.MALFORMED_MESSAGE
maps toMalformedMessageException
.AGENT_NOT_FOUND
maps toAgentNotFoundException
.
The message
property of the AgentServiceError
is passed as the exception's message.
Return
An AgentEngineException
instance that corresponds to the current error type.