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

Commit

Permalink
Merge pull request #462 from maryia-matskevich-deriv/maryia/FEQ-1877
Browse files Browse the repository at this point in the history
fix: TrackJS BBot: There was an error listing files from Google Drive - Error: {}
  • Loading branch information
farabi-deriv authored Jun 18, 2024
2 parents e377370 + 5ebe815 commit b698352
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
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']));
}
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

0 comments on commit b698352

Please sign in to comment.