private boolean handleTopLevelError(Errors error, RaftResponse.Inbound response) {
        if (error == Errors.BROKER_NOT_AVAILABLE) {
            return false;
        } else if (error == Errors.CLUSTER_AUTHORIZATION_FAILED) {
            throw new ClusterAuthorizationException("Received cluster authorization error in response " + response);
        } else {
            return handleUnexpectedError(error, response);
        }
    }
Handle response errors that are common across request types.

@param error Error from the received response
@param leaderId Optional leaderId from the response
@param epoch Epoch received from the response
@param leaderEndpoints the endpoints of the leader from the response
@param source the node that sent the response
@param currentTimeMs Current epoch time in milliseconds
@return Optional value indicating whether the error was handled here and the outcome of
   that handling. Specifically:

   - Optional.empty means that the response was not handled here and the custom
       API handler should be applied
   - Optional.of(true) indicates that the response was successfully handled here and
       the node can become ready
   - Optional.of(false) indicates that the response was handled here, but that the
       node should got in to backoff
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java