GH-1268 ... and catch the inevitable errors

This commit is contained in:
Petr Mrázek 2015-10-05 23:52:23 +02:00
parent 439c6b43a3
commit 4fbcb3efb9

View File

@ -177,8 +177,15 @@ void InstanceList::saveGroupList()
} }
toplevel.insert("groups", groupsArr); toplevel.insert("groups", groupsArr);
QJsonDocument doc(toplevel); QJsonDocument doc(toplevel);
try
{
FS::write(groupFileName, doc.toJson()); FS::write(groupFileName, doc.toJson());
} }
catch(FS::FileSystemException & e)
{
qCritical() << "Failed to write instance group file :" << e.cause();
}
}
void InstanceList::loadGroupList(QMap<QString, QString> &groupMap) void InstanceList::loadGroupList(QMap<QString, QString> &groupMap)
{ {