Catch analytics errors (#770)

This commit is contained in:
Kristian Dupont 2017-01-03 15:16:46 +01:00 committed by GitHub
parent cce41ebcf1
commit 6bbdb34da0
1 changed files with 3 additions and 2 deletions

View File

@ -44,7 +44,7 @@ function getDarwinIdentifier() {
}
const mac = iface[0].mac.replace(/:/g, '');
return Buffer.from(mac, 'hex');
return new Buffer(mac, 'hex');
}
function getLinuxIdentifier() {
@ -89,7 +89,8 @@ module.exports = function(eventName) {
}
};
request(`https://api.mixpanel.com/track/?data=${Buffer.from(JSON.stringify(payload), 'utf8').toString('base64')}&ip=1`);
request(`https://api.mixpanel.com/track/?data=${Buffer.from(JSON.stringify(payload), 'utf8').toString('base64')}&ip=1`,
() => { /* Analytics failed. Do nothing. */ });
}
if (require.main === module) {