For now, caught serialization error in some ilink3 msgs.

This commit is contained in:
Pedro Pinto committed 2020-06-30 14:10:07 -04:00
1 parent 1e0c75c6c7
commit d940d9f11d
1 file changed
+7 -1
@@ -80,7 +80,13 @@ static void save_raw_msg(std::ofstream &out, RawMessageDirection d,
j["direction"] = d == RawMessageDirection::INCOMING ? "<" : ">";
j["time"] = datetime::FIX_timestamp(datetime::now());
j["msg_sbe"] = websocketpp::base64_encode(msg.binary);
j["msg_json"] = nlohmann::json::parse(msg.json);
try {
j["msg_json"] = nlohmann::json::parse(msg.json);
}
catch (...) {
LOG(iLink3, Error, "Trouble parsing json encode message: {}", msg.json);
j["msg_json"] = nlohmann::json {};
}
out << j << std::endl;
out.flush();
}