aboutsummaryrefslogtreecommitdiff
path: root/src/convert_json.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/convert_json.cpp')
-rw-r--r--src/convert_json.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/convert_json.cpp b/src/convert_json.cpp
index e03508e21..e548c45f5 100644
--- a/src/convert_json.cpp
+++ b/src/convert_json.cpp
@@ -52,7 +52,13 @@ Json::Value fetchJsonValue(const std::string &url,
if (!reader.parse(stream, root)) {
errorstream << "URL: " << url << std::endl;
errorstream << "Failed to parse json data " << reader.getFormattedErrorMessages();
- errorstream << "data: \"" << fetch_result.data << "\"" << std::endl;
+ if (fetch_result.data.size() > 100) {
+ errorstream << "Data (" << fetch_result.data.size()
+ << " bytes) printed to warningstream." << std::endl;
+ warningstream << "data: \"" << fetch_result.data << "\"" << std::endl;
+ } else {
+ errorstream << "data: \"" << fetch_result.data << "\"" << std::endl;
+ }
return Json::Value();
}