Interface RpcMethodError
public interface RpcMethodError
The
RpcMethodError interface defines the structure for RPC error handling within the
context of plugins. It provides methods to retrieve error code, message, and an optional data
decoder function.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe error code for all invalid params -
Method Summary
Modifier and TypeMethodDescriptiondecodeData(String data) Some errors have additional data associated with them, that is possible to decode to provide a more detailed error response.intgetCode()Retrieves the error code associated with the RPC error.Retrieves the message associated with the RPC error.
-
Field Details
-
INVALID_PARAMS_ERROR_CODE
static final int INVALID_PARAMS_ERROR_CODEThe error code for all invalid params- See Also:
-
-
Method Details
-
getCode
int getCode()Retrieves the error code associated with the RPC error.- Returns:
- An integer representing the error code.
-
getMessage
String getMessage()Retrieves the message associated with the RPC error.- Returns:
- A
Stringcontaining the error message.
-
decodeData
Some errors have additional data associated with them, that is possible to decode to provide a more detailed error response.- Parameters:
data- the additional data to decode- Returns:
- an optional containing the decoded data if the error has it and the decoding is successful, otherwise empty.
-