IsCantOpenError checks if the error is a SQLite CANTOPEN error (code 14).
(err error)
| 55 | |
| 56 | // IsCantOpenError checks if the error is a SQLite CANTOPEN error (code 14). |
| 57 | func IsCantOpenError(err error) bool { |
| 58 | if sqliteErr, ok := errors.AsType[*sqlite.Error](err); ok { |
| 59 | return sqliteErr.Code() == sqlite3.SQLITE_CANTOPEN |
| 60 | } |
| 61 | return false |
| 62 | } |
| 63 | |
| 64 | // DiagnoseDBOpenError provides a more helpful error message when SQLite |
| 65 | // fails to open/create a database file. |
no outgoing calls
no test coverage detected