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

Method constructor

src/db/open-error.ts:50–65  ·  view source on GitHub ↗
(original: Error, dbPath: string)

Source from the content-addressed store, hash-verified

48 readonly dbPath: string;
49
50 constructor(original: Error, dbPath: string) {
51 const codes = original as Error & { code?: unknown; errcode?: unknown; errstr?: unknown };
52 const primary = typeof codes.errcode === 'number' ? codes.errcode & 0xff : -1;
53 const sqliteCode = SQLITE_CODE_NAMES[primary] ?? `SQLite error ${String(codes.errcode)}`;
54 const hint = HINTS[sqliteCode];
55 super(
56 `Could not open the CodeGraph database at ${dbPath}: ${original.message} (${sqliteCode}).${hint ? ` ${hint}` : ''}`,
57 { cause: original }
58 );
59 this.name = 'DatabaseOpenError';
60 this.code = codes.code;
61 this.errcode = codes.errcode;
62 this.errstr = codes.errstr;
63 this.sqliteCode = sqliteCode;
64 this.dbPath = dbPath;
65 }
66}
67
68/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected