@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 +24 -1
- package/package.json +1 -1
- package/src/channel.ts +1025 -106
- package/src/core/status.ts +10 -10
- package/src/core/types.ts +3 -0
- package/src/messaging/outbound/send.ts +2 -0
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
|
-
|
|
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) => {
|