MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / toDatabaseOpenError

Function toDatabaseOpenError

src/db/open-error.ts:75–85  ·  view source on GitHub ↗
(err: unknown, dbPath: string)

Source from the content-addressed store, hash-verified

73 * explanation included.
74 */
75export function toDatabaseOpenError(err: unknown, dbPath: string): unknown {
76 if (err instanceof DatabaseOpenError || err instanceof WslSharedIndexError || err instanceof NodeSqliteUnavailableError) {
77 return err;
78 }
79 const shared = toWslSharedIndexError(err, dbPath);
80 if (shared) return shared;
81 if (err instanceof Error && typeof (err as { errcode?: unknown }).errcode === 'number') {
82 return new DatabaseOpenError(err, dbPath);
83 }
84 return err;
85}
86
87/**
88 * A project's index exists but could not be opened: what a caller reports as

Callers 3

withOpenFailuresFunction · 0.90
createDatabaseFunction · 0.90

Calls 1

toWslSharedIndexErrorFunction · 0.90

Tested by

no test coverage detected