refs #815 Catch and handle CJsonException when calling convertFromJson.

This commit is contained in:
Mathew Sutcliffe
2016-12-21 02:27:21 +00:00
parent 4f6d3ed3a3
commit 51c3ae8c25
8 changed files with 65 additions and 18 deletions

View File

@@ -21,7 +21,7 @@
#include "blackmisc/propertyindex.h"
#include "blackmisc/range.h"
#include "blackmisc/slot.h"
#include "blackmisc/statusmessage.h"
#include "blackmisc/statusmessagelist.h"
#include "blackmisc/valuecacheprivate.h"
#include "blackmisc/variant.h"
#include "blackmisc/variantmap.h"
@@ -193,9 +193,14 @@ namespace BlackMisc
//! Load all values in Json format.
//! Values already in the cache will remain in the cache unless they are overwritten.
//! \throws BlackMisc::CJsonException if JSON schema validation fails.
//! \threadsafe
void loadFromJson(const QJsonObject &json);
//! Call loadFromJson, catch any CJsonException that are thrown and return them as CStatusMessage.
//! \threadsafe
CStatusMessageList loadFromJsonNoThrow(const QJsonObject &json, const CLogCategoryList &categories, const QString &prefix);
//! Save values to Json files in a given directory.
//! If prefix is provided then only those values whose keys start with that prefix.
//! \threadsafe