code: public String getErrorMessage(IOException e) {
      // Prefer to use message from GJRE.
      GoogleJsonResponseException gjre = getJsonResponseExceptionOrNull(e);
  
      if (gjre != null && gjre.getDetails() != null) {
        return gjre.getDetails().getMessage();
      }
      return e.getMessage();
    }
docs: Extracts the error message.