Fix calibre-debug --reinit-db

This commit is contained in:
Kovid Goyal 2022-06-20 09:00:38 +05:30
parent 00f8528d1b
commit a4cbe12a43
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 1 additions and 3 deletions

View File

@ -19,8 +19,6 @@ from calibre.utils.date import EPOCH, utcnow
from .pool import Pool
from .schema_upgrade import SchemaUpgrade
# TODO: check that switching libraries with indexing enabled/disabled works
# TODO: db dump+restore
# TODO: calibre export/import should preserve indexed data
# TODO: check library and vacuuming of fts db

View File

@ -146,7 +146,7 @@ def reinit_db(dbpath):
last_restore_error = None
try:
dest.execute(statement)
except sqlite3.OperationalError as e:
except (sqlite3.OperationalError, sqlite3.IntegrityError) as e:
last_restore_error = as_unicode(e)
# The dump produces an extra commit at the end, so
# only print this error if there are more