code: protected void handleAppendResponseError(MemberState member, AppendRequest request, AppendResponse response) {
      // If we've received a greater term, update the term and transition back to follower.
      if (response.term() > context.getTerm()) {
        logger.debug("{} - Received higher term from {}", context.getClusterState().member().address(), member.getMember().serverAddress());
        context.setTerm(response.term()).setLeader(0);
        context.transition(CopycatServer.State.FOLLOWER);
      } else {
        super.handleAppendResponseError(member, request, response);
      }
    }
docs: Handles a {@link Response.Status#ERROR} response.