@xmoxmo/bncr 0.2.3 → 0.2.4

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/index.ts CHANGED
@@ -408,7 +408,30 @@ const dispatchGatewayMethod = (name: GatewayMethodName, opts: any) => {
408
408
  if (!bridge) {
409
409
  throw new Error(`bncr gateway runtime unavailable for ${name}`);
410
410
  }
411
- return gatewayMethodDispatchers[name](bridge, opts);
411
+ try {
412
+ return gatewayMethodDispatchers[name](bridge, opts);
413
+ } catch (error) {
414
+ const detail =
415
+ error instanceof Error
416
+ ? {
417
+ name: error.name,
418
+ message: error.message,
419
+ stack: error.stack || null,
420
+ }
421
+ : { name: 'NonError', message: String(error), stack: null };
422
+ emitBncrLogLine(
423
+ 'error',
424
+ `[bncr] gateway method error ${JSON.stringify({
425
+ method: name,
426
+ bridgeId: bridge.getBridgeId?.() || null,
427
+ gatewayPid: bridge.gatewayPid || null,
428
+ detail,
429
+ })}`,
430
+ { debugOnly: true },
431
+ () => true,
432
+ );
433
+ throw error;
434
+ }
412
435
  };
413
436
 
414
437
  const mirrorGatewayMethodForMockApi = (api: OpenClawPluginApi, name: GatewayMethodName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmoxmo/bncr",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",