Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

fix: TrackJS BBot: There was an error listing files from Google Drive - Error: {} #462

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions src/utilities/integrations/GoogleDrive.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']));
}
maryia-matskevich-deriv marked this conversation as resolved.
Show resolved Hide resolved
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);
}
};
Expand Down
1 change: 1 addition & 0 deletions src/utilities/integrations/trackJSTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading