From c37fe938f14fd1f284def4f54beecb5ff757c254 Mon Sep 17 00:00:00 2001 From: Andre Pimenta Date: Mon, 26 Oct 2020 16:26:20 +0000 Subject: [PATCH] sync log errors (#1901) --- app/util/syncWithExtension.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/util/syncWithExtension.js b/app/util/syncWithExtension.js index 6b051c2a2dc..138089d83a6 100644 --- a/app/util/syncWithExtension.js +++ b/app/util/syncWithExtension.js @@ -55,7 +55,7 @@ export default class PubNubWrapper { sendByPost: false, storeInHistory: false }, - () => { + (status, response) => { setTimeout(() => { if (this.timeout) { const error = new Error('Sync::timeout'); @@ -65,6 +65,10 @@ export default class PubNubWrapper { resolve(); } }, EXPIRED_CODE_TIMEOUT); + + if (status && status.error) { + Logger.error(new Error('Sync::error-startSync'), { ...status, ...response }); + } } ); }); @@ -115,7 +119,7 @@ export default class PubNubWrapper { sendByPost: false, storeInHistory: false }, - () => { + (status, response) => { this.disconnectWebsockets(); this.pubnub = new PubNub({ subscribeKey: SUB_KEY, @@ -126,6 +130,10 @@ export default class PubNubWrapper { this.channelName = channelName; this.cipherKey = cipherKey; resolve(); + + if (status && status.error) { + Logger.error(new Error('Sync::error-establishConnection'), { ...status, ...response }); + } } ); });