diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index 058b52ff5..ef7231a76 100755 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -693,10 +693,14 @@ class Transaction(object): cursor = self.db._connection().execute(statement, subvals) return cursor.lastrowid except sqlite3.OperationalError as e: + # In two specific cases, SQLite reports an error while accessing + # the underlying database file. We surface these exceptions as + # DBAccessError so the application can abort. if e.args[0] in ("attempt to write a readonly database", "unable to open database file"): - raise DBAccessError('Unable to open database file.' - 'It might be a permissions problem') + raise DBAccessError(e.args[0]) + else: + raise def script(self, statements): """Execute a string containing multiple SQL statements."""