COMPMID-415 Fixed JSON printer to output errors as an array of single lines instead of a multi-line string

Change-Id: I02a14fac2dbf31beb9c6e8a7744c47ccab207996
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/83374
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
diff --git a/framework/printers/JSONPrinter.cpp b/framework/printers/JSONPrinter.cpp
index 3408174..10cc911 100644
--- a/framework/printers/JSONPrinter.cpp
+++ b/framework/printers/JSONPrinter.cpp
@@ -102,9 +102,15 @@
 
 void JSONPrinter::print_error(const std::exception &error)
 {
-    print_separator(_first_error);
+    std::stringstream error_log;
+    error_log.str(error.what());
 
-    *_stream << R"(")" << error.what() << R"(")";
+    for(std::string line; !std::getline(error_log, line).eof();)
+    {
+        print_separator(_first_error);
+
+        *_stream << R"(")" << line << R"(")";
+    }
 }
 
 void JSONPrinter::print_measurements(const Profiler::MeasurementsMap &measurements)