Merge pull request #3005 from vvvrrooomm/master

Improve error messages in case of sqlite errors
This commit is contained in:
Adrian Sampson 2018-08-15 18:31:03 -04:00 committed by GitHub
commit b79b7594c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -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} cannot not be opened: {1}".format(
util.displayable_path(dbpath),
db_error
))
log.debug(u'library database: {0}\n'
u'library directory: {1}',

View file

@ -50,6 +50,9 @@ Fixes:
with CORS enabled.
Thanks to :user:`rveachkc`.
:bug:`2979`: :bug:`2980`
* Improve error reporting: during startup if sqlite returns an error the
sqlite error message is attached to the beets message.
:bug:`3005`
.. _python-itunes: https://github.com/ocelma/python-itunes