From d940d9f11dfea08cfcb7d09ca145e454b088abdf Mon Sep 17 00:00:00 2001 From: Pedro Pinto Date: Tue, 30 Jun 2020 14:10:07 -0400 Subject: [PATCH] For now, caught serialization error in some ilink3 msgs. --- src/lib/orderman/actors/ilink3/SessionStore.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/orderman/actors/ilink3/SessionStore.cpp b/src/lib/orderman/actors/ilink3/SessionStore.cpp index 14d1c61a4..d45ab5a9e 100644 --- a/src/lib/orderman/actors/ilink3/SessionStore.cpp +++ b/src/lib/orderman/actors/ilink3/SessionStore.cpp @@ -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(); }