refactor(errors): consolidate message formatting (#117818)

This commit is contained in:
Peter Steinberger
2026-08-01 22:05:49 -07:00
committed by GitHub
parent 4b26a15a1f
commit e98fdeefdf
86 changed files with 320 additions and 498 deletions
@@ -1,5 +1,6 @@
import { createRequire } from "node:module";
import { pathToFileURL } from "node:url";
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
export type NodeLlamaCppModule = typeof import("node-llama-cpp");
@@ -11,10 +12,6 @@ function isNodeLlamaCppMissing(error: unknown): boolean {
return code === "ERR_MODULE_NOT_FOUND" && error.message.includes("node-llama-cpp");
}
function formatErrorMessage(error: unknown): string {
return error instanceof Error ? error.message : String(error);
}
export function formatLlamaCppSetupError(error: unknown): string {
const detail = formatErrorMessage(error);
const missing = isNodeLlamaCppMissing(error);