refactor: dedupe provider bootstrap error formatting

This commit is contained in:
Peter Steinberger
2026-04-07 01:15:34 +01:00
parent 8a40cd7ed4
commit 77a161c811
9 changed files with 19 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
import type { OpenClawConfig, OpenClawPluginApi } from "../api.js";
import { applyMemoryWikiMutation, normalizeMemoryWikiMutationInput } from "./apply.js";
import { compileMemoryWikiVault } from "./compile.js";
@@ -78,7 +79,7 @@ function readEnumParam<T extends string>(
}
function respondError(respond: GatewayRespond, error: unknown) {
const message = error instanceof Error ? error.message : String(error);
const message = formatErrorMessage(error);
respond(false, undefined, { code: "internal_error", message });
}