diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 25a2c1a09..764f904c9 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -888,7 +888,9 @@ def _open_library(config): get_path_formats(), get_replacements(), ) - except sqlite3.OperationalError: + lib.get_item(0) # Test database connection. + except (sqlite3.OperationalError, sqlite3.DatabaseError): + log.debug(traceback.format_exc()) raise UserError(u"database file {0} could not be opened".format( util.displayable_path(dbpath) )) diff --git a/docs/changelog.rst b/docs/changelog.rst index be4da501b..0f4c908ab 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -14,6 +14,7 @@ New: Fixed: * Fix a new crash with the latest version of Mutagen (1.26). +* We now print a better error message when the database file is corrupted. .. _Plex: https://plex.tv/