Interface JsonRpcErrorHandler

All Superinterfaces:
ServerLifecycle
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface JsonRpcErrorHandler extends ServerLifecycle
A JSON-RPC handler that can process invalid requests if registered.
  • Method Details

    • handle

      Optional<JsonRpcError> handle(ServerRequest req, JsonObject jsonObject) throws Exception
      Handler for a JSON-RPC erroneous request.
      Parameters:
      req - the server request
      jsonObject - an invalid JSON-RPC request as a JSON object
      Returns:
      an optional JSON-RPC error to be returned to the client. If empty, then no error is returned.
      Throws:
      Exception - if an unexpected condition is found