Closed izak closed 1 year ago
There is a lot here that is not being caught.
sqlite3.DatabaseError: file is not a database <--- I corrupted the file with zeroes at the start
sqlite3.DatabaseError: malformed database schema (?) <--- I left the heading intact but wrote zeroes 512 bytes into it
Safer to rather treat all DatabaseErrors the same: As a sign of corruption.
Scenario:
The code around
nonvolatilequeueramdiskwrapper.py
, line 58 (where the error is raised) will switch to a RAM-disk on some errors. But not this one.According to documentation,
sqlite3.DatabaseError
is an unexpected exception to show up here. We would expect an OperationalError.Nevertheless, it seems one easy improvement, is to catch the base error here, so we can more smoothly switch to RAM-disk. Then we at least continue logging. So: