diag: Log emumba cfg parse error code

This commit is contained in:
John Colvin committed 2022-10-11 23:19:47 -04:00
1 parent 912bda2aeb
commit 6040f37a7e
2 files changed
+6 -4

No files matched your search

@@ -141,8 +141,9 @@ std::optional<DeribitDemoConfiguration> DeribitDemoConfiguration::read_file(
rapidjson::IStreamWrapper isw{configFile};
rapidjson::Document doc{};
if (doc.ParseStream(isw).HasParseError()) {
LOG(md, Error, "Error in parsing config from {}", config_path);
auto &res = doc.ParseStream(isw);
if (res.HasParseError()) {
LOG(md, Error, "Error in parsing config from {}: {}", config_path, res.GetParseError());
return std::nullopt;
}
@@ -21,6 +21,7 @@
#include <boost/filesystem.hpp>
#include <memory>
#include <optional>
#include <set>
using namespace std;
@@ -47,8 +48,8 @@ struct EmumbaMain::PImpl {
listener(sec_index, producer) {
auto config_path =
os::sparkdata_path("conf") + "deribit_demo_config.json";
std::optional<bts::cmds::DeribitDemoConfiguration> conf =
bts::cmds::DeribitDemoConfiguration::read_file(config_path);
auto conf = bts::cmds::DeribitDemoConfiguration::read_file(config_path);
bts_assert_msg(conf.has_value(), "Failed to parse deribit config");
// log
for (const auto &s : conf.value().symbol_config_list) {
LOG(md, Info, "sub.symbol: {}", s.symbol_name);