Add better error logging in Octree::writeToJSONFile

This commit is contained in:
Ryan Huffman 2018-06-13 12:57:06 -07:00
parent c2f08dfdba
commit 2b49d84a22

View file

@ -978,9 +978,14 @@ bool Octree::writeToJSONFile(const char* fileName, const OctreeElementPointer& e
if (persistFile.open(QIODevice::WriteOnly)) {
if (persistFile.write(jsonDataForFile) != -1) {
success = persistFile.commit();
if (!success) {
qCritical() << "Failed to commit to JSON save file:" << persistFile.errorString();
}
} else {
qCritical("Failed to write to JSON file.");
}
} else {
qCritical("Could not write to JSON description of entities.");
qCritical("Failed to open JSON file for writing.");
}
return success;