npm-groovy-lint 14.0.1-beta202312161504.0 → 14.0.1

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.
Files changed (2) hide show
  1. package/lib/analytics.js +11 -3
  2. package/package.json +1 -1
package/lib/analytics.js CHANGED
@@ -29,9 +29,17 @@ 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
- const amplitudeProm = amplitudeClient.track(events);
33
- debug("Analytics sent: " + eventType + " " + JSON.stringify(events));
34
- return amplitudeProm;
32
+ return (async resolve => {
33
+ // Failing to send analytics isn't fatal.
34
+ try {
35
+ await amplitudeClient.track(events);
36
+ debug(`Analytics sent type: ${eventType} ${JSON.stringify(events)}`);
37
+ } catch (err) {
38
+ debug(`Analytics send failed type: ${eventType} ${JSON.stringify(events)} ${err}`);
39
+ } finally {
40
+ resolve();
41
+ }
42
+ })();
35
43
  }
36
44
 
37
45
  // Build payload for main linter event
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-groovy-lint",
3
- "version": "14.0.1-beta202312161504.0",
3
+ "version": "14.0.1",
4
4
  "description": "Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files",
5
5
  "main": "index.js",
6
6
  "scripts": {