private static IOException makeIOExceptionOfException(Throwable e) {
    Throwable t = e;
    if (e instanceof ServiceException) {
      t = e.getCause();
    }
    if (ExceptionUtil.isInterrupt(t)) {
      return ExceptionUtil.asInterrupt(t);
    }
    if (t instanceof RemoteException) {
      t = ((RemoteException) t).unwrapRemoteException();
    }
    return t instanceof IOException ? (IOException) t : new HBaseIOException(t);
  }
Like {@link #getRemoteException(ServiceException)} but more generic, able to handle more than
just {@link ServiceException}. Prefer this method to
{@link #getRemoteException(ServiceException)} because trying to contain direct protobuf
references.
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java