{"record":{"id":"95c80eda87576f0f","repo":"earendil-works/pi","slug":"message-result-error-message-95c80e","errorCode":null,"errorMessage":"${message}: ${result.error.message}","messagePattern":"\\$\\{message\\}: \\$\\{result\\.error\\.message\\}","errorType":"exception","errorClass":"SessionError","httpStatus":null,"severity":"error","filePath":"packages/session-backends/sqlite-node/src/sqlite/search-backend.ts","lineNumber":22,"sourceCode":"\tSessionSearch,\n\tSessionSearchHit,\n\tSessionSearchOptions,\n} from \"@earendil-works/pi-agent-core\";\nimport { SessionError } from \"@earendil-works/pi-agent-core\";\nimport { applyMigrations } from \"./migrations.ts\";\nimport { sql } from \"./sql.ts\";\nimport { decodeSessionMetadata, type SessionRow } from \"./storage/sessions.ts\";\nimport type {\n\tSqliteDatabase,\n\tSqliteDatabaseFactory,\n\tSqliteSessionMetadata,\n\tSqliteSessionRepositoryEnv,\n} from \"./types.ts\";\n\nfunction getFileSystemResultOrThrow<TValue>(result: Result<TValue, FileError>, message: string): TValue {\n\tif (!result.ok) {\n\t\tconst code = result.error.code === \"not_found\" ? \"not_found\" : \"storage\";\n\t\tthrow new SessionError(code, `${message}: ${result.error.message}`, result.error);\n\t}\n\treturn result.value;\n}\n\nfunction getParentPath(path: string): string {\n\tconst normalized = path.replace(/[\\\\/]+$/, \"\");\n\tconst lastSlash = Math.max(normalized.lastIndexOf(\"/\"), normalized.lastIndexOf(\"\\\\\"));\n\tif (lastSlash < 0) return \".\";\n\tif (lastSlash === 0) return normalized.slice(0, 1);\n\treturn normalized.slice(0, lastSlash);\n}\n\nfunction throwIfAborted(signal: AbortSignal | undefined): void {\n\tif (!signal?.aborted) return;\n\tif (signal.reason instanceof Error) throw signal.reason;\n\tconst error = new Error(\"The operation was aborted\");\n\terror.name = \"AbortError\";\n\tthrow error;","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/session-backends/sqlite-node/src/sqlite/search-backend.ts#L4-L40","documentation":"Error \"${message}: ${result.error.message}\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/session-backends/sqlite-node/src/sqlite/search-backend.ts:22 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped SQLite error message for the underlying failure."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}