public void onEvent(ReplicaId replicaId, Object event) {
    if (event instanceof ServerErrorCode) {
      onServerEvent(replicaId, (ServerErrorCode) event);
    } else if (event instanceof Exception) {
      onException(replicaId, (Exception) event);
    } else if (event instanceof NetworkClientErrorCode) {
      onNetworkEvent(replicaId, (NetworkClientErrorCode) event);
    }
  }
Action to take when a request to the given {@link ReplicaId} results in an event. The event could come in the
form of an {@link Exception}, {@link NetworkClientErrorCode}, or a {@link ServerErrorCode} (possibly indicating
that there was no error).
@param replicaId the {@link ReplicaId} to which the request was sent.
@param event the type of the event. The event could be an {@link Exception}, {@link NetworkClientErrorCode} or a
{@link ServerErrorCode}.
ambry-commons/src/main/java/com/github/ambry/commons/ResponseHandler.java