diff --git a/src/utilities/integrations/GoogleDrive.js b/src/utilities/integrations/GoogleDrive.js index 71b90a8de..c418ccbfc 100644 --- a/src/utilities/integrations/GoogleDrive.js +++ b/src/utilities/integrations/GoogleDrive.js @@ -148,16 +148,27 @@ class GoogleDriveUtil { const picker = document.getElementsByClassName('picker-dialog-content')[0]; picker.parentNode.removeChild(picker); }, 500); + this.client.requestAccessToken({ prompt: '' }); - } + const message = err?.result?.error?.errors[0]?.message; + const reason = err?.result?.error?.errors[0]?.reason; + const code = err?.result?.error?.code; + const status = err?.result?.error?.status; + + const errorObject = { + error: { + error: { + message: `${message}, status: ${status}, code: ${code} `, + code: reason, + }, + }, + }; + trackJSTrack(errorObject); + } else { + errLogger(JSON.stringify(err, ['message', 'arguments', 'type', 'name'])); + } const error = translate('There was an error listing files from Google Drive'); - - errLogger( - JSON.stringify(err, ['message', 'arguments', 'type', 'name']), - translate('There was an error listing files from Google Drive') - ); - globalObserver.emit('Error', error); } }; diff --git a/src/utilities/integrations/trackJSTrack.js b/src/utilities/integrations/trackJSTrack.js index 22ddb3744..7bfc16b9c 100644 --- a/src/utilities/integrations/trackJSTrack.js +++ b/src/utilities/integrations/trackJSTrack.js @@ -8,6 +8,7 @@ export const default_errors_to_ignore = [ 'RateLimit', 'DisconnectError', 'MarketIsClosed', + 'authError', // Invalid Credentials, access token's been expired, show pop-up modal to sign in ]; export function trackJSTrack(error) {