npm-groovy-lint 14.2.3 → 14.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/analytics.js +16 -11
- package/package.json +1 -1
package/lib/analytics.js
CHANGED
|
@@ -29,17 +29,22 @@ async function recordAnonymousEvent(eventType, data) {
|
|
|
29
29
|
const linterEvent = buildLinterEvent(eventType, data);
|
|
30
30
|
events.push(linterEvent);
|
|
31
31
|
events.push(...(await buildFileStatsEvents(linterEvent, data)));
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
try {
|
|
33
|
+
return (async resolve => {
|
|
34
|
+
// Failing to send analytics isn't fatal.
|
|
35
|
+
try {
|
|
36
|
+
await amplitudeClient.track(events);
|
|
37
|
+
debug(`Analytics sent type: ${eventType} ${JSON.stringify(events)}`);
|
|
38
|
+
} catch (err) {
|
|
39
|
+
debug(`Analytics send failed type: ${eventType} ${JSON.stringify(events)} ${err}`);
|
|
40
|
+
} finally {
|
|
41
|
+
resolve();
|
|
42
|
+
}
|
|
43
|
+
})();
|
|
44
|
+
} catch (e) {
|
|
45
|
+
debug(`Analytics send failed type: ${eventType} ${JSON.stringify(events)} ${e}`);
|
|
46
|
+
return Promise.resolve();
|
|
47
|
+
}
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
// Build payload for main linter event
|