diff --git a/launcher/history-db.ts b/launcher/history-db.ts index 830a878f..2459da6c 100644 --- a/launcher/history-db.ts +++ b/launcher/history-db.ts @@ -58,7 +58,9 @@ export function isReadonlyWalRetryError(error: unknown, dbPath: string): boolean return ( text.includes('readonly') || text.includes('read-only') || - text.includes('attempt to write a readonly database') + text.includes('attempt to write a readonly database') || + text.includes('sqlite_cantopen') || + text.includes('unable to open database file') ); } diff --git a/launcher/history.test.ts b/launcher/history.test.ts index 1b5ed8b9..5d332652 100644 --- a/launcher/history.test.ts +++ b/launcher/history.test.ts @@ -300,6 +300,15 @@ test('isReadonlyWalRetryError only accepts readonly errors from WAL-mode databas ), true, ); + assert.equal( + isReadonlyWalRetryError( + Object.assign(new Error('unable to open database file'), { + code: 'SQLITE_CANTOPEN', + }), + walDbPath, + ), + true, + ); assert.equal( isReadonlyWalRetryError(new Error('no such table: imm_sessions'), walDbPath), false,