code: protected GoogleJsonError getDetails(IOException e) {
      if (e instanceof GoogleJsonResponseException) {
        return ((GoogleJsonResponseException) e).getDetails();
      }
      return null;
    }
docs: If the exception is a GoogleJsonResponseException, get the
  error details, else return null.