@shopgate/tracking-core 7.32.2-alpha.6 → 7.32.2-alpha.8

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/core/Core.js +7 -4
  2. package/package.json +3 -3
package/core/Core.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { logger } from '@shopgate/pwa-core/helpers';
2
+ import { toError } from '@shopgate/pwa-core/helpers/error';
2
3
  import errorManager from '@shopgate/pwa-core/classes/ErrorManager';
3
4
  import { SOURCE_TRACKING, CODE_TRACKING } from '@shopgate/pwa-core/constants/ErrorManager';
4
5
  import { optOut as _optOut, isOptOut } from "../helpers/optOut";
@@ -299,11 +300,13 @@ let Core = /*#__PURE__*/function () {
299
300
  }
300
301
  try {
301
302
  entry.callback.apply(this, params);
302
- } catch (err) {
303
+ } catch (thrown) {
304
+ const err = toError(thrown, {
305
+ code: CODE_TRACKING,
306
+ source: SOURCE_TRACKING,
307
+ context: entry.trackerName
308
+ });
303
309
  logger.error(`'SgTrackingCore': Error in plugin [${entry.trackerName}]`, err);
304
- err.code = CODE_TRACKING;
305
- err.source = SOURCE_TRACKING;
306
- err.context = entry.trackerName;
307
310
  errorManager.queue(err);
308
311
  }
309
312
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/tracking-core",
3
- "version": "7.32.2-alpha.6",
3
+ "version": "7.32.2-alpha.8",
4
4
  "description": "Tracking core library for the Shopgate Connect PWA.",
5
5
  "author": "Shopgate <support@shopgate.com>",
6
6
  "license": "Apache-2.0",
@@ -20,8 +20,8 @@
20
20
  "connect"
21
21
  ],
22
22
  "devDependencies": {
23
- "@shopgate/eslint-config": "7.32.2-alpha.6",
24
- "@shopgate/pwa-core": "7.32.2-alpha.6",
23
+ "@shopgate/eslint-config": "7.32.2-alpha.8",
24
+ "@shopgate/pwa-core": "7.32.2-alpha.8",
25
25
  "@types/lodash": "^4.17.25",
26
26
  "lodash": "^4.18.1"
27
27
  }