rescue SQLite3::IOException => e
    io_attempts += 1
    raise "Database I/O error #{path}: #{e.message}" if io_attempts >= 3

    sleep(1)