mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 04:40:43 +00:00
refactor: dedupe plugin task error formatting
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import crypto from "node:crypto";
|
||||
import { formatErrorMessage } from "../infra/errors.js";
|
||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||
import {
|
||||
getTaskFlowRegistryObservers,
|
||||
@@ -212,7 +213,7 @@ function ensureFlowRegistryReady() {
|
||||
restoreFailureMessage = null;
|
||||
} catch (error) {
|
||||
flows.clear();
|
||||
restoreFailureMessage = error instanceof Error ? error.message : String(error);
|
||||
restoreFailureMessage = formatErrorMessage(error);
|
||||
log.warn("Failed to restore task-flow registry", { error });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import crypto from "node:crypto";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { onAgentEvent } from "../infra/agent-events.js";
|
||||
import { formatErrorMessage } from "../infra/errors.js";
|
||||
import { requestHeartbeatNow } from "../infra/heartbeat-wake.js";
|
||||
import { enqueueSystemEvent } from "../infra/system-events.js";
|
||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||
@@ -1783,7 +1784,7 @@ export async function cancelTaskById(params: {
|
||||
return {
|
||||
found: true,
|
||||
cancelled: false,
|
||||
reason: error instanceof Error ? error.message : String(error),
|
||||
reason: formatErrorMessage(error),
|
||||
task: cloneTaskRecord(task),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user