@blocklet/sdk 1.17.0-beta-20251105-000053-53e6e3e9 → 1.17.0-beta-20251105-095418-158ab2fa

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.
@@ -83,13 +83,14 @@ const doCall = ({ url, componentName, callPath, headers = {}, ...options }, retr
83
83
  headers,
84
84
  });
85
85
  const duration = Date.now() - startTime;
86
- debug(`component.call succeed in ${duration}ms: ${url} `);
86
+ debug(`component.call to ${componentName} succeed in ${duration}ms: ${url} `);
87
87
  return res;
88
88
  }
89
89
  catch (error) {
90
90
  const duration = Date.now() - startTime;
91
91
  config_1.default.logger.error(`component.call failed in ${duration}ms`, {
92
92
  url,
93
+ componentName,
93
94
  responseStatus: (0, get_1.default)(error, 'response.status'),
94
95
  responseData: (0, get_1.default)(error, 'response.data'),
95
96
  error: (0, get_1.default)(error, 'message'),
@@ -126,7 +127,7 @@ const call = async ({ name, method = 'POST', path: _path, ...options }, retryOpt
126
127
  catch (error) {
127
128
  const component = getComponent(name);
128
129
  if (component.status !== constant_1.BlockletStatus.running) {
129
- throw new Error(`component ${name} is not running`);
130
+ throw new Error(`component ${name} is not running, status: ${component.status}`);
130
131
  }
131
132
  throw error;
132
133
  }
@@ -312,14 +312,24 @@ const cleanup = () => {
312
312
  };
313
313
  exports.cleanup = cleanup;
314
314
  const on = async (event, cb) => {
315
- await (0, exports.ensureClient)();
315
+ try {
316
+ await (0, exports.ensureClient)();
317
+ }
318
+ catch (err) {
319
+ console.warn(`Error when subscribing to event: ${event}`, err);
320
+ }
316
321
  return emitter.on(event, cb);
317
322
  };
318
323
  exports.on = on;
319
324
  exports.off = emitter.off.bind(emitter);
320
325
  exports._message = {
321
326
  on: async (event, cb) => {
322
- await (0, exports.ensureClient)();
327
+ try {
328
+ await (0, exports.ensureClient)();
329
+ }
330
+ catch (err) {
331
+ console.warn(`Error when subscribing to message event: ${event}`, err);
332
+ }
323
333
  return messageEmitter.on(event, cb);
324
334
  },
325
335
  off: messageEmitter.off.bind(messageEmitter),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.17.0-beta-20251105-000053-53e6e3e9",
6
+ "version": "1.17.0-beta-20251105-095418-158ab2fa",
7
7
  "description": "graphql client to read/write data on abt node",
8
8
  "homepage": "https://www.arcblock.io/docs/blocklet-sdk-nodejs",
9
9
  "main": "lib/index.js",
@@ -26,26 +26,26 @@
26
26
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@abtnode/constant": "1.17.0-beta-20251105-000053-53e6e3e9",
30
- "@abtnode/db-cache": "1.17.0-beta-20251105-000053-53e6e3e9",
31
- "@abtnode/util": "1.17.0-beta-20251105-000053-53e6e3e9",
32
- "@arcblock/did": "^1.27.1",
33
- "@arcblock/did-connect-js": "^1.27.1",
34
- "@arcblock/did-ext": "^1.27.1",
35
- "@arcblock/jwt": "^1.27.1",
36
- "@arcblock/ws": "^1.27.1",
37
- "@blocklet/constant": "1.17.0-beta-20251105-000053-53e6e3e9",
38
- "@blocklet/env": "1.17.0-beta-20251105-000053-53e6e3e9",
39
- "@blocklet/error": "^0.3.0",
40
- "@blocklet/meta": "1.17.0-beta-20251105-000053-53e6e3e9",
41
- "@blocklet/server-js": "1.17.0-beta-20251105-000053-53e6e3e9",
42
- "@blocklet/theme": "^3.1.54",
29
+ "@abtnode/constant": "1.17.0-beta-20251105-095418-158ab2fa",
30
+ "@abtnode/db-cache": "1.17.0-beta-20251105-095418-158ab2fa",
31
+ "@abtnode/util": "1.17.0-beta-20251105-095418-158ab2fa",
32
+ "@arcblock/did": "^1.27.2",
33
+ "@arcblock/did-connect-js": "^1.27.2",
34
+ "@arcblock/did-ext": "^1.27.2",
35
+ "@arcblock/jwt": "^1.27.2",
36
+ "@arcblock/ws": "^1.27.2",
37
+ "@blocklet/constant": "1.17.0-beta-20251105-095418-158ab2fa",
38
+ "@blocklet/env": "1.17.0-beta-20251105-095418-158ab2fa",
39
+ "@blocklet/error": "^0.3.1",
40
+ "@blocklet/meta": "1.17.0-beta-20251105-095418-158ab2fa",
41
+ "@blocklet/server-js": "1.17.0-beta-20251105-095418-158ab2fa",
42
+ "@blocklet/theme": "^3.1.56",
43
43
  "@did-connect/authenticator": "^2.2.8",
44
44
  "@did-connect/handler": "^2.2.8",
45
45
  "@nedb/core": "^2.1.5",
46
- "@ocap/mcrypto": "^1.27.1",
47
- "@ocap/util": "^1.27.1",
48
- "@ocap/wallet": "^1.27.1",
46
+ "@ocap/mcrypto": "^1.27.2",
47
+ "@ocap/util": "^1.27.2",
48
+ "@ocap/wallet": "^1.27.2",
49
49
  "axios": "^1.7.9",
50
50
  "cheerio": "1.0.0-rc.12",
51
51
  "debug": "^4.4.1",
@@ -82,5 +82,5 @@
82
82
  "ts-node": "^10.9.1",
83
83
  "typescript": "^5.6.3"
84
84
  },
85
- "gitHead": "61a1b994cca350a1c7cd12debc39416ac3af1a5d"
85
+ "gitHead": "bce9e12ce054d3caf16b5b0806f6ed6f141ab34c"
86
86
  }