public static IOException unwrapRemoteIOException(Procedure<?> proc) {
    Exception e = proc.getException().unwrapRemoteException();
    // Do not retry ProcedureExceptions!
    return (e instanceof ProcedureException)
      ? new DoNotRetryIOException(e)
      : proc.getException().unwrapRemoteIOException();
  }
This is a version of unwrapRemoteIOException that can do DoNotRetryIOE. We need to throw DNRIOE
to clients if a failed Procedure else they will keep trying. The default
proc.getException().unwrapRemoteException doesn't have access to DNRIOE from the procedure2
module.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureUtil.java