Package io.a2a.spec

Class A2AProtocolError

All Implemented Interfaces:
Event, Serializable
Direct Known Subclasses:
ContentTypeNotSupportedError, ExtendedAgentCardNotConfiguredError, ExtensionSupportRequiredError, InvalidAgentResponseError, PushNotificationNotSupportedError, TaskNotCancelableError, TaskNotFoundError, UnsupportedOperationError, VersionNotSupportedError

public class A2AProtocolError extends A2AError
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.

See Also:
  • Constructor Details

    • A2AProtocolError

      public A2AProtocolError(Integer code, String message, @Nullable Object data, @Nullable String url)
      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

      public @Nullable String 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