mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 15:58:27 +00:00
fix: resolve check errors in nodes-tool and commands-ptt
This commit is contained in:
@@ -454,7 +454,9 @@ export function createNodesTool(options?: {
|
|||||||
invokeParams = JSON.parse(invokeParamsJson);
|
invokeParams = JSON.parse(invokeParamsJson);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const message = err instanceof Error ? err.message : String(err);
|
const message = err instanceof Error ? err.message : String(err);
|
||||||
throw new Error(`invokeParamsJson must be valid JSON: ${message}`);
|
throw new Error(`invokeParamsJson must be valid JSON: ${message}`, {
|
||||||
|
cause: err,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const invokeTimeoutMs = parseTimeoutMs(params.invokeTimeoutMs);
|
const invokeTimeoutMs = parseTimeoutMs(params.invokeTimeoutMs);
|
||||||
|
|||||||
@@ -187,10 +187,7 @@ export const handlePTTCommand: CommandHandler = async (params, allowTextCommands
|
|||||||
params: invokeParams,
|
params: invokeParams,
|
||||||
config: cfg,
|
config: cfg,
|
||||||
});
|
});
|
||||||
const payload =
|
const payload = res.payload && typeof res.payload === "object" ? res.payload : {};
|
||||||
res.payload && typeof res.payload === "object"
|
|
||||||
? (res.payload as Record<string, unknown>)
|
|
||||||
: {};
|
|
||||||
|
|
||||||
const lines = [`PTT ${actionKey} → ${nodeId}`];
|
const lines = [`PTT ${actionKey} → ${nodeId}`];
|
||||||
if (typeof payload.status === "string") {
|
if (typeof payload.status === "string") {
|
||||||
|
|||||||
Reference in New Issue
Block a user