GrandyB / SheetsIO

Small configurable Java app that pulls data from a Google Spreadsheet (using v4 api) and writes to files and a local webserver.
GNU Lesser General Public License v3.0
22 stars 3 forks source link

Improve Server returned 403 http response code error message #13

Closed GrandyB closed 4 years ago

GrandyB commented 4 years ago

Need to implement a better error message for when the spreadsheet is inaccessible, with details on what might fix it.

The actual fix is to allow sharing to 'anyone with the link can view' on the google sheets side.

Example error:

2020-34-11 17:34:07.571 [Thread-5] ERROR application.Main - java.io.IOException: Server returned HTTP response code: 403 for URL: https://sheets.googleapis.com/v4/spreadsheets/spreadsheet_id_here/values/Sheet1?key=api_key_here&majorDimension=COLUMNS&valueRenderOption=FORMATTED_VALUE
2020-34-11 17:34:07.571 [Thread-5] ERROR application.Main - sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
java.net.URLConnection.getContent(Unknown Source)
sun.net.www.protocol.https.HttpsURLConnectionImpl.getContent(Unknown Source)
application.UpdateController.getLatestState(UpdateController.java:102)
application.UpdateController.update(UpdateController.java:85)
application.UpdateRunnable.run(UpdateRunnable.java:53)
java.lang.Thread.run(Unknown Source)
...
GrandyB commented 4 years ago

Released in v0.5