summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-10-05 23:52:23 +0200
committerPetr Mrázek <peterix@gmail.com>2015-10-05 23:52:23 +0200
commit4fbcb3efb90368c084946600afdca05ca7c65519 (patch)
treef24f42704fc4b47f47caf5db04635eeac806307e
parent439c6b43a3432e604afbcef74c36ae5fb73de12b (diff)
downloadMultiMC-4fbcb3efb90368c084946600afdca05ca7c65519.tar
MultiMC-4fbcb3efb90368c084946600afdca05ca7c65519.tar.gz
MultiMC-4fbcb3efb90368c084946600afdca05ca7c65519.tar.lz
MultiMC-4fbcb3efb90368c084946600afdca05ca7c65519.tar.xz
MultiMC-4fbcb3efb90368c084946600afdca05ca7c65519.zip
GH-1268 ... and catch the inevitable errors
-rw-r--r--logic/InstanceList.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/logic/InstanceList.cpp b/logic/InstanceList.cpp
index 3644e828..b791cc32 100644
--- a/logic/InstanceList.cpp
+++ b/logic/InstanceList.cpp
@@ -177,7 +177,14 @@ void InstanceList::saveGroupList()
}
toplevel.insert("groups", groupsArr);
QJsonDocument doc(toplevel);
- FS::write(groupFileName, doc.toJson());
+ try
+ {
+ 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)