public static void toIOException(ServiceException se) throws IOException {
    Objects.requireNonNull(se, "Service exception cannot be null");

    Throwable cause = se.getCause();
    if (cause != null && cause instanceof IOException) {
      throw (IOException) cause;
    }
    throw new IOException(se);
  }
Unwraps an exception from a protobuf service into the underlying (expected) IOException. This
method will <strong>always</strong> throw an exception.
@param se the {@code ServiceException} instance to convert into an {@code IOException}
@throws NullPointerException if {@code se} is {@code null}
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java