@rebilly/risk-data-collector 2.2.0 → 2.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebilly/risk-data-collector",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Microlibrary that collects browser data for risk assessment",
5
5
  "type": "module",
6
6
  "main": "dist/data-collector.js",
package/src/kount.js CHANGED
@@ -28,7 +28,7 @@ const addKountScriptElement = ({
28
28
  };
29
29
 
30
30
  export default async function getFraudSessionId({ env, kountAccountId, kountSessionId }) {
31
- return new Promise((resolve) => {
31
+ return new Promise((resolve, reject) => {
32
32
  const kountScript = addKountScriptElement({
33
33
  env,
34
34
  kountAccountId,
@@ -45,5 +45,8 @@ export default async function getFraudSessionId({ env, kountAccountId, kountSess
45
45
  });
46
46
  client.autoLoadEvents();
47
47
  };
48
+ kountScript.onerror = () => {
49
+ reject(new Error('Error attempting to mount Kount script'));
50
+ };
48
51
  });
49
52
  }