Package com.github.copilot.sdk.json
Class JsonRpcError
java.lang.Object
com.github.copilot.sdk.json.JsonRpcError
JSON-RPC 2.0 error structure.
This is an internal class representing an error in a JSON-RPC response. It contains an error code, message, and optional additional data.
Standard Error Codes
- -32700: Parse error
- -32600: Invalid Request
- -32601: Method not found
- -32602: Invalid params
- -32603: Internal error
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetCode()Gets the error code.getData()Gets the additional error data.Gets the error message.voidsetCode(int code) Sets the error code.voidSets the additional error data.voidsetMessage(String message) Sets the error message.
-
Constructor Details
-
JsonRpcError
public JsonRpcError()
-
-
Method Details
-
getCode
public int getCode()Gets the error code.- Returns:
- the integer error code
-
setCode
public void setCode(int code) Sets the error code.- Parameters:
code- the integer error code
-
getMessage
Gets the error message.- Returns:
- the human-readable error message
-
setMessage
Sets the error message.- Parameters:
message- the error message
-
getData
Gets the additional error data.- Returns:
- the additional data, or
nullif none
-
setData
Sets the additional error data.- Parameters:
data- the additional data
-