From b767fc6abbd853265358f1fe0fe59b7c3b3290ba Mon Sep 17 00:00:00 2001 From: Donald Pipowitch Date: Mon, 7 Dec 2020 17:03:33 +0100 Subject: [PATCH] fixes #142 --- src/amplitude-client.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/amplitude-client.js b/src/amplitude-client.js index 14a91a8f..2cf9f9a7 100644 --- a/src/amplitude-client.js +++ b/src/amplitude-client.js @@ -1358,6 +1358,9 @@ AmplitudeClient.prototype._logEvent = function _logEvent( return eventId; } catch (e) { utils.log.error(e); + if (type(callback) === 'function') { + callback(0, 'No request sent', {reason: 'Request failed (e.g. it was blocked).'}); + } } };