Skip to content

Commit

Permalink
fix: Log error from google API when retrieving access token
Browse files Browse the repository at this point in the history
see #1562

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Aug 26, 2024
1 parent 95fc1f6 commit be68758
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/adapters/GoogleDrive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,12 @@ export default class GoogleDriveAdapter extends CachingAdapter {
})

if (response.status !== 200) {
Logger.log('Failed to retrieve refresh token from Google API: ' + await response.text())
throw new OAuthTokenError()
}
const json = await response.json()
if (!json.access_token || !json.refresh_token) {
Logger.log('Failed to retrieve refresh token from Google API: ' + JSON.stringify(json))
throw new OAuthTokenError()
}

Expand Down Expand Up @@ -155,6 +157,7 @@ export default class GoogleDriveAdapter extends CachingAdapter {
)

if (response.status !== 200) {
Logger.log('Failed to retrieve access token from Google API: ' + await response.text())
throw new GoogleDriveAuthenticationError()
}

Expand Down

0 comments on commit be68758

Please sign in to comment.