earendil-works/pi · error · SessionError
${message}: ${result.error.message}
Error message
${message}: ${result.error.message} What it means
Error "${message}: ${result.error.message}" thrown in earendil-works/pi.
Source
Thrown at packages/session-backends/sqlite-node/src/sqlite/search-backend.ts:22
SessionSearch,
SessionSearchHit,
SessionSearchOptions,
} from "@earendil-works/pi-agent-core";
import { SessionError } from "@earendil-works/pi-agent-core";
import { applyMigrations } from "./migrations.ts";
import { sql } from "./sql.ts";
import { decodeSessionMetadata, type SessionRow } from "./storage/sessions.ts";
import type {
SqliteDatabase,
SqliteDatabaseFactory,
SqliteSessionMetadata,
SqliteSessionRepositoryEnv,
} from "./types.ts";
function getFileSystemResultOrThrow<TValue>(result: Result<TValue, FileError>, message: string): TValue {
if (!result.ok) {
const code = result.error.code === "not_found" ? "not_found" : "storage";
throw new SessionError(code, `${message}: ${result.error.message}`, result.error);
}
return result.value;
}
function getParentPath(path: string): string {
const normalized = path.replace(/[\\/]+$/, "");
const lastSlash = Math.max(normalized.lastIndexOf("/"), normalized.lastIndexOf("\\"));
if (lastSlash < 0) return ".";
if (lastSlash === 0) return normalized.slice(0, 1);
return normalized.slice(0, lastSlash);
}
function throwIfAborted(signal: AbortSignal | undefined): void {
if (!signal?.aborted) return;
if (signal.reason instanceof Error) throw signal.reason;
const error = new Error("The operation was aborted");
error.name = "AbortError";
throw error;View on GitHub (pinned to 4af9d21d3b)
Solutions
- Inspect the wrapped SQLite error message for the underlying failure.
When it happens
Trigger: Thrown at packages/session-backends/sqlite-node/src/sqlite/search-backend.ts:22 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/95c80eda87576f0f.
Report an issue: GitHub.