hadoop-connectors/gcsio - no message in exception

Viewed 18

GoogleCloudStorageExceptions.java

It looks like HttpResponseException is created without message.

  public static GoogleJsonResponseException createJsonResponseException(
      GoogleJsonError e, HttpHeaders responseHeaders) {
    if (e != null) {
// ISSUE: HttpResponseException.Builder() constructor below doesn't set HttpResponseException.Builder.message.
//        HttpResponseException.Builder.message is passed to Throwable.detailMessage that is printed in Throwable.toString().
//        As a result, received from server exception doesn't print any information, it prints: null.
      return new GoogleJsonResponseException(
          new HttpResponseException.Builder(e.getCode(), e.getMessage(), responseHeaders), e);
    }
    return null;
  }
0 Answers
Related