mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-30 07:21:32 -07:00
fix(history-db): treat SQLITE_CANTOPEN as readonly WAL retry error
- Add `sqlite_cantopen` and `unable to open database file` to `isReadonlyWalRetryError` checks - Cover `SQLITE_CANTOPEN` case in test
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user