public static Throwable unwrapCompletionException(Throwable error) {
    if (error instanceof CompletionException) {
      Throwable cause = error.getCause();
      if (cause != null) {
        return cause;
      }
    }
    return error;
  }
Get the cause of the {@link Throwable} if it is a {@link CompletionException}.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/FutureUtils.java