diff --git a/src/gateway/embeddings-http.ts b/src/gateway/embeddings-http.ts index 0c83e86b15c..c42053db1ca 100644 --- a/src/gateway/embeddings-http.ts +++ b/src/gateway/embeddings-http.ts @@ -3,6 +3,7 @@ import type { IncomingMessage, ServerResponse } from "node:http"; import { resolveAgentDir } from "../agents/agent-scope.js"; import { resolveMemorySearchConfig } from "../agents/memory-search.js"; import { loadConfig } from "../config/config.js"; +import { formatErrorMessage } from "../infra/errors.js"; import { logWarn } from "../logger.js"; import { getMemoryEmbeddingProvider, @@ -85,10 +86,6 @@ function validateInputTexts(texts: string[]): string | undefined { return undefined; } -function formatErrorMessage(err: unknown): string { - return err instanceof Error ? err.message : String(err); -} - function resolveAutoExplicitProviders(cfg: ReturnType): Set { return new Set( listMemoryEmbeddingProviders(cfg)