mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
refactor(errors): consolidate message formatting (#117818)
This commit is contained in:
committed by
GitHub
parent
4b26a15a1f
commit
e98fdeefdf
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user