[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,
sqlite3.SQLITE_CONSTRAINT_PRIMARYKEY:
return db.ErrAlreadyExists
case sqlite3.SQLITE_BUSY:
case sqlite3.SQLITE_BUSY,
sqlite3.SQLITE_BUSY_SNAPSHOT,
sqlite3.SQLITE_BUSY_RECOVERY:
return errBusy
case sqlite3.SQLITE_BUSY_TIMEOUT:
return db.ErrBusyTimeout