@onekeyfe/hd-core 1.1.24-alpha.2 → 1.1.25-alpha.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/constants/errors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,UAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/constants/errors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,UAAW,GAAG,UAcxC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -28848,6 +28848,7 @@ class DeviceUpdateReboot extends BaseMethod {
|
|
|
28848
28848
|
}
|
|
28849
28849
|
|
|
28850
28850
|
const safeThrowError = (error) => {
|
|
28851
|
+
var _a;
|
|
28851
28852
|
if (error instanceof hdShared.HardwareError) {
|
|
28852
28853
|
throw error;
|
|
28853
28854
|
}
|
|
@@ -28861,7 +28862,9 @@ const safeThrowError = (error) => {
|
|
|
28861
28862
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BridgeNetworkError);
|
|
28862
28863
|
}
|
|
28863
28864
|
else {
|
|
28864
|
-
|
|
28865
|
+
const message = (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : String(error);
|
|
28866
|
+
const name = (error === null || error === void 0 ? void 0 : error.name) ? `${error.name}: ` : '';
|
|
28867
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.UnknownError, `${name}${message}`);
|
|
28865
28868
|
}
|
|
28866
28869
|
};
|
|
28867
28870
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.25-alpha.0",
|
|
4
4
|
"description": "Core processes and APIs for communicating with OneKey hardware devices.",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-shared": "1.1.
|
|
29
|
-
"@onekeyfe/hd-transport": "1.1.
|
|
28
|
+
"@onekeyfe/hd-shared": "1.1.25-alpha.0",
|
|
29
|
+
"@onekeyfe/hd-transport": "1.1.25-alpha.0",
|
|
30
30
|
"axios": "1.12.2",
|
|
31
31
|
"bignumber.js": "^9.0.2",
|
|
32
32
|
"bytebuffer": "^5.0.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"@types/w3c-web-usb": "^1.0.10",
|
|
45
45
|
"@types/web-bluetooth": "^0.0.21"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "8cebdb9dea32ab8bfa39c51cd695f5cd9508defa"
|
|
48
48
|
}
|
package/src/constants/errors.ts
CHANGED
|
@@ -10,6 +10,8 @@ export const safeThrowError = (error: any) => {
|
|
|
10
10
|
} else if (error.code === 'ERR_BAD_REQUEST') {
|
|
11
11
|
throw ERRORS.TypedError(HardwareErrorCode.BridgeNetworkError);
|
|
12
12
|
} else {
|
|
13
|
-
|
|
13
|
+
const message = error?.message ?? String(error);
|
|
14
|
+
const name = error?.name ? `${error.name}: ` : '';
|
|
15
|
+
throw ERRORS.TypedError(HardwareErrorCode.UnknownError, `${name}${message}`);
|
|
14
16
|
}
|
|
15
17
|
};
|