[bugfix] add all possible busy result codes to the sqlite errBusy catching check (#2775)

This commit is contained in:
kim 2024-03-22 12:26:02 +00:00 committed by GitHub
parent 967558947a
commit 0767647056
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,7 +72,9 @@ func processSQLiteError(err error) error {
case sqlite3.SQLITE_CONSTRAINT_UNIQUE, case sqlite3.SQLITE_CONSTRAINT_UNIQUE,
sqlite3.SQLITE_CONSTRAINT_PRIMARYKEY: sqlite3.SQLITE_CONSTRAINT_PRIMARYKEY:
return db.ErrAlreadyExists return db.ErrAlreadyExists
case sqlite3.SQLITE_BUSY: case sqlite3.SQLITE_BUSY,
sqlite3.SQLITE_BUSY_SNAPSHOT,
sqlite3.SQLITE_BUSY_RECOVERY:
return errBusy return errBusy
case sqlite3.SQLITE_BUSY_TIMEOUT: case sqlite3.SQLITE_BUSY_TIMEOUT:
return db.ErrBusyTimeout return db.ErrBusyTimeout