Error handling for fatal SQL exceptions
Gajim should have error handling for certain SQL exceptions we've seen in the past:
-
sqlite3.DatabaseError: database disk image is malformed
: For cache.db we simply reinitialize cache storage. While this would be okay-ish for settings.db and omemo.db, that's a no go for logs.db. In the case of logs.db, we need to inform the user about a critical database error and add an option to reinitialize (while creating a copy of the malformed database). See #11130 (closed), #10779 (closed), #9139 (closed) -
sqlite3.OperationalError: attempt to write a readonly database
: This issue has been seen for logs.db, cache.db, settings.db, and omemo.db from time to time on various operating systems. Since it may in some cases be a result of a locked file (AV software, etc.), we should probably inform the user as well and point to solutions (restart OS, check file, etc.) or offer to recreate storage. See #11081 (closed), #10976 (closed) -
sqlite3.OperationalError: database or disk is full
: In this case we should quit Gajim directly and leave a single dialog open which tells the user about the situation. Right now this situation leads to hundreds of database tracebacks. See #11428 (closed), #10864 (closed), #10864 (closed)