Package org.a2aproject.sdk.spec
Enum Class A2AErrorCodes
- All Implemented Interfaces:
Serializable,Comparable<A2AErrorCodes>,Constable
All the error codes for A2A errors.
Each constant provides:
code()- the JSON-RPC error codegrpcStatus()- the corresponding gRPC status namehttpCode()- the HTTP status code
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionError code indicating the content type is not supported (-32005).Error code indicating extended agent card is not configured (-32007).Error code indicating client requested use of an extension marked as required: true in the Agent Card but the client did not declare support for it in the request (-32008).JSON-RPC error code for internal server errors (-32603).Error code indicating the agent returned an invalid response (-32006).JSON-RPC error code for invalid method parameters (-32602).JSON-RPC error code for invalid request structure (-32600).JSON-RPC error code for JSON parsing errors (-32700).JSON-RPC error code for method not found (-32601).Error code indicating push notifications are not supported by this agent (-32003).Error code indicating the task cannot be canceled in its current state (-32002).Error code indicating the requested task was not found (-32001).Error code indicating the requested operation is not supported (-32004).Error code indicating the A2A protocol version specified in the request (via A2A-Version service parameter) is not supported by the agent (-32009). -
Method Summary
Modifier and TypeMethodDescriptionintcode()Returns the JSON-RPC error code.static @Nullable A2AErrorCodesfromCode(int code) Looks up an error code enum constant by its JSON-RPC numeric code.Returns the corresponding gRPC status name.inthttpCode()Returns the HTTP status code.static A2AErrorCodesReturns the enum constant of this class with the specified name.static A2AErrorCodes[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TASK_NOT_FOUND
Error code indicating the requested task was not found (-32001). -
TASK_NOT_CANCELABLE
Error code indicating the task cannot be canceled in its current state (-32002). -
PUSH_NOTIFICATION_NOT_SUPPORTED
Error code indicating push notifications are not supported by this agent (-32003). -
UNSUPPORTED_OPERATION
Error code indicating the requested operation is not supported (-32004). -
CONTENT_TYPE_NOT_SUPPORTED
Error code indicating the content type is not supported (-32005). -
INVALID_AGENT_RESPONSE
Error code indicating the agent returned an invalid response (-32006). -
EXTENDED_AGENT_CARD_NOT_CONFIGURED
Error code indicating extended agent card is not configured (-32007). -
EXTENSION_SUPPORT_REQUIRED
Error code indicating client requested use of an extension marked as required: true in the Agent Card but the client did not declare support for it in the request (-32008). -
VERSION_NOT_SUPPORTED
Error code indicating the A2A protocol version specified in the request (via A2A-Version service parameter) is not supported by the agent (-32009). -
INVALID_REQUEST
JSON-RPC error code for invalid request structure (-32600). -
METHOD_NOT_FOUND
JSON-RPC error code for method not found (-32601). -
INVALID_PARAMS
JSON-RPC error code for invalid method parameters (-32602). -
INTERNAL
JSON-RPC error code for internal server errors (-32603). -
JSON_PARSE
JSON-RPC error code for JSON parsing errors (-32700).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
code
public int code()Returns the JSON-RPC error code.- Returns:
- the numeric error code
-
grpcStatus
Returns the corresponding gRPC status name.- Returns:
- the gRPC status string (e.g., "NOT_FOUND", "INTERNAL")
-
httpCode
public int httpCode()Returns the HTTP status code.- Returns:
- the HTTP status code
-
fromCode
Looks up an error code enum constant by its JSON-RPC numeric code.- Parameters:
code- the JSON-RPC error code- Returns:
- the matching enum constant, or
nullif not found
-