public static <T> Callback<T> chainCallback(Callback<T> callback, ThrowingFunction<T, T> preAction) {
    return chainCallbackInternal(callback, preAction);
  }
Create a {@link Callback} that invokes the preAction and then the callback with error handling.
It is meant to be a part of multi-step callback chain and handle intermediate failures in a consistent way.
@param <T> the input and result type for the callback.
@param callback the callback to call after the preAction.
@param preAction the optional action to take before the callback is called.
@return the managed {@link Callback}.
ambry-api/src/main/java/com/github/ambry/commons/CallbackUtils.java