From a4cbe12a43d959934718221aac77655723e30183 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 20 Jun 2022 09:00:38 +0530 Subject: [PATCH] Fix calibre-debug --reinit-db --- src/calibre/db/fts/connect.py | 2 -- src/calibre/debug.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/calibre/db/fts/connect.py b/src/calibre/db/fts/connect.py index 6b1b381f5b..6de2e37571 100644 --- a/src/calibre/db/fts/connect.py +++ b/src/calibre/db/fts/connect.py @@ -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 diff --git a/src/calibre/debug.py b/src/calibre/debug.py index a59eb7f0b3..2f64d1c1d8 100644 --- a/src/calibre/debug.py +++ b/src/calibre/debug.py @@ -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