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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The error code for all invalid params
  • Method Summary

    Modifier and Type
    Method
    Description
    default Optional<String>
    Some errors have additional data associated with them, that is possible to decode to provide a more detailed error response.
    int
    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_CODE
      The 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 String containing the error message.
    • decodeData

      default Optional<String> decodeData(String data)
      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.