public void then(final Consumer<ResponseStream> onSuccess, final Consumer<Throwable> onError) {
    result.whenComplete(
        (result, error) -> {
          if (error != null) {
            onError.accept(error);
          } else {
            onSuccess.accept(result);
          }
        });
  }
Register callbacks for when the request is made or

@param onSuccess handler for when a peer becomes available and the request is sent
@param onError handler for when there is no peer with sufficient height or the request fails to
    send
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/PendingPeerRequest.java