Package org.a2aproject.sdk.spec
Class InvalidParamsError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.a2aproject.sdk.spec.A2AError
org.a2aproject.sdk.spec.InvalidParamsError
- All Implemented Interfaces:
Serializable,Event
JSON-RPC error indicating that method parameters are invalid or missing required fields.
This error is returned when a JSON-RPC method is called with parameters that fail validation. Common causes include:
- Missing required parameters
- Parameters of incorrect type
- Parameter values outside acceptable ranges
- Malformed parameter structures
Corresponds to JSON-RPC 2.0 error code -32602.
Usage example:
// Default error with standard message
throw new InvalidParamsError();
// Custom error message
throw new InvalidParamsError("taskId parameter is required");
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an invalid params error with default message.InvalidParamsError(@Nullable Integer code, @Nullable String message, @Nullable Map<String, Object> details) Constructs an invalid params error with full parameters.InvalidParamsError(@Nullable String message) Constructs an invalid params error with a message. -
Method Summary
Methods inherited from class org.a2aproject.sdk.spec.A2AError
getCode, getDetailsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
InvalidParamsError
public InvalidParamsError(@Nullable Integer code, @Nullable String message, @Nullable Map<String, Object> details) Constructs an invalid params error with full parameters.- Parameters:
code- the error codemessage- the error messagedetails- additional error details
-
InvalidParamsError
Constructs an invalid params error with a message.- Parameters:
message- the error message
-
InvalidParamsError
public InvalidParamsError()Constructs an invalid params error with default message.
-