Add better logging for file open and write errors
This commit is contained in:
@@ -138,8 +138,9 @@ int DeviceDatabaseBackend::AddDevice(const Device &device) {
|
||||
// Create the songs tables for the device
|
||||
QString filename(":/schema/device-schema.sql");
|
||||
QFile schema_file(filename);
|
||||
if (!schema_file.open(QIODevice::ReadOnly))
|
||||
qFatal("Couldn't open schema file %s", filename.toUtf8().constData());
|
||||
if (!schema_file.open(QIODevice::ReadOnly)) {
|
||||
qFatal("Couldn't open schema file %s: %s", filename.toUtf8().constData(), schema_file.errorString().toUtf8().constData());
|
||||
}
|
||||
QString schema = QString::fromUtf8(schema_file.readAll());
|
||||
schema.replace("%deviceid", QString::number(id));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user