mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-25 23:47:20 +00:00
refactor: dedupe script error formatting
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { DatabaseSync } from "node:sqlite";
|
||||
import { load, getLoadablePath } from "sqlite-vec";
|
||||
import { formatErrorMessage } from "./lib/error-format.mjs";
|
||||
|
||||
function vec(values) {
|
||||
return Buffer.from(new Float32Array(values).buffer);
|
||||
@@ -10,7 +11,7 @@ const db = new DatabaseSync(":memory:", { allowExtension: true });
|
||||
try {
|
||||
load(db);
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : String(err);
|
||||
const message = formatErrorMessage(err);
|
||||
console.error("sqlite-vec load failed:");
|
||||
console.error(message);
|
||||
console.error("expected extension path:", getLoadablePath());
|
||||
|
||||
Reference in New Issue
Block a user