Improve error messages in case of sqlite errors
@@ -1193,10 +1193,11 @@ def _open_library(config):
get_replacements(),
)
lib.get_item(0) # Test database connection.
- except (sqlite3.OperationalError, sqlite3.DatabaseError):
+ except (sqlite3.OperationalError, sqlite3.DatabaseError) as db_error:
log.debug(u'{}', traceback.format_exc())
- raise UserError(u"database file {0} could not be opened".format(
- util.displayable_path(dbpath)
+ raise UserError(u"database file {0} could not be opened, reason: {1}".format(
+ util.displayable_path(dbpath),
+ db_error
))
log.debug(u'library database: {0}\n'
u'library directory: {1}',
