From eaf3fe16ebea5d458de3e2cf80c2d4b81a0b820e Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 17 Mar 2016 12:05:01 +0000 Subject: [PATCH] sync error: Don't log the exception twice If we have e.stack, then it will include the description of the exception. --- lib/sync.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/sync.js b/lib/sync.js index 440d18886..7ec080ae6 100644 --- a/lib/sync.js +++ b/lib/sync.js @@ -519,7 +519,9 @@ SyncApi.prototype._sync = function(syncOptions) { self._processSyncResponse(syncToken, data); } catch (e) { - console.error("Caught /sync error", e, e.stack); + // log the exception with stack if we have it, else fall back + // to the plain description + console.error("Caught /sync error", e.stack || e); } // emit synced events