Package io.a2a.spec
Class A2AProtocolError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.a2a.spec.A2AError
io.a2a.spec.A2AProtocolError
- All Implemented Interfaces:
Event,Serializable
- Direct Known Subclasses:
ContentTypeNotSupportedError,ExtendedAgentCardNotConfiguredError,ExtensionSupportRequiredError,InvalidAgentResponseError,PushNotificationNotSupportedError,TaskNotCancelableError,TaskNotFoundError,UnsupportedOperationError,VersionNotSupportedError
Represents a protocol-level error in the A2A Protocol with a reference URL.
This error extends A2AError to include a URL field that provides a reference
to documentation, specification details, or additional context about the protocol error.
This is particularly useful for protocol version mismatches, unsupported features, or
other situations where pointing to the protocol specification would help diagnose the issue.
-
Constructor Summary
ConstructorsConstructorDescriptionA2AProtocolError(Integer code, String message, @Nullable Object data, @Nullable String url) Constructs a protocol error with the specified code, message, data, and reference URL. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
A2AProtocolError
Constructs a protocol error with the specified code, message, data, and reference URL.- Parameters:
code- the numeric error code (required, see JSON-RPC 2.0 spec for standard codes)message- the human-readable error message (required)data- additional error information, structure defined by the error code (optional)url- URL reference providing additional context about this protocol error (optional)
-
-
Method Details
-
getUrl
Gets the URL reference for additional information about this protocol error.This URL typically points to protocol specification documentation or other resources that provide context about the error condition.
- Returns:
- the reference URL, or null if not provided
-