Class A2AAgentCardException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.langchain4j.exception.LangChain4jException
dev.langchain4j.agentic.agent.AgentUnavailableException
dev.langchain4j.agentic.a2a.A2AAgentCardException
- All Implemented Interfaces:
Serializable
Thrown when the agent card of a remote A2A agent cannot be fetched. The card is fetched lazily, the first time
it is needed, which is normally the first invocation of the agent, so this exception reaches the caller of that
invocation and the error handler of the agentic system, where it can be recognized to skip or retry an
unavailable remote agent, by this type or by its supertype
AgentUnavailableException, common to every
integration. A fetch that does not complete within the resolution timeout of the agent, 30 seconds by default, is
interrupted and reported with this exception too, with a TimeoutException as cause. As long as a fetch
that timed out has not reacted to its interruption, the card cannot be fetched again: the invocations arriving
in the meantime fail at once, with a message saying that the previous fetch is still running. Concurrent first
invocations wait on the same fetch and all fail when it fails, each with its own exception sharing that cause,
but a failed fetch is not cached: the next invocation retries it.- Since:
- 1.24.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionA2AAgentCardException(String agentName, String a2aServerUrl, Throwable cause) -
Method Summary
Methods inherited from class AgentUnavailableException
agentNameMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
A2AAgentCardException
-
-
Method Details
-
a2aServerUrl
- Returns:
- the URL of the A2A server the card was requested from, as configured; the message of this exception shows it without user info and query, which may contain credentials
- Since:
- 1.24.0
-