mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
Расширяем вывод информации об ошибке при чтении json
This commit is contained in:
@@ -22,7 +22,7 @@ bool jsonRead(const String& json, String key, long& value, bool e) {
|
|||||||
return false;
|
return false;
|
||||||
} else if (!doc.containsKey(key)) {
|
} else if (!doc.containsKey(key)) {
|
||||||
if (e) {
|
if (e) {
|
||||||
SerialPrint("E", F("jsonRead"), key + " missing");
|
SerialPrint("E", F("jsonRead"), key + " missing in " + json);
|
||||||
jsonErrorDetected();
|
jsonErrorDetected();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -42,7 +42,7 @@ bool jsonRead(const String& json, String key, float& value, bool e) {
|
|||||||
return false;
|
return false;
|
||||||
} else if (!doc.containsKey(key)) {
|
} else if (!doc.containsKey(key)) {
|
||||||
if (e) {
|
if (e) {
|
||||||
SerialPrint("E", F("jsonRead"), key + " missing");
|
SerialPrint("E", F("jsonRead"), key + " missing in " + json);
|
||||||
jsonErrorDetected();
|
jsonErrorDetected();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -62,7 +62,7 @@ bool jsonRead(const String& json, String key, String& value, bool e) {
|
|||||||
return false;
|
return false;
|
||||||
} else if (!doc.containsKey(key)) {
|
} else if (!doc.containsKey(key)) {
|
||||||
if (e) {
|
if (e) {
|
||||||
SerialPrint("E", F("jsonRead"), key + " missing");
|
SerialPrint("E", F("jsonRead"), key + " missing in " + json);
|
||||||
jsonErrorDetected();
|
jsonErrorDetected();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -89,7 +89,7 @@ bool jsonRead(const String& json, String key, int& value, bool e) {
|
|||||||
return false;
|
return false;
|
||||||
} else if (!doc.containsKey(key)) {
|
} else if (!doc.containsKey(key)) {
|
||||||
if (e) {
|
if (e) {
|
||||||
SerialPrint("E", F("jsonRead"), key + " missing");
|
SerialPrint("E", F("jsonRead"), key + " missing in " + json);
|
||||||
jsonErrorDetected();
|
jsonErrorDetected();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user