atomicDEX-API
atomicDEX-API copied to clipboard
Komodefi shouldn't panic incase of bad `event_stream_configuration`
currently, when Komodefi tries to parse incorrect event_stream_configuration, the program panics which doesn't sit well for me so I thought logging the error and continue with program is best
https://github.com/KomodoPlatform/komodo-defi-framework/blob/b0fd99e8406e67ea06435dd028991caa5f522b5c/mm2src/mm2_core/src/mm_ctx.rs#L725-L728
I guess this is better.
let event_stream_configuration =
json::from_value(event_stream_configuration.clone());
match event_stream_configuration {
Ok(config) => ctx.event_stream_configuration = Some(config),
Err(err) => {
error!("Bad/Invalid events streaming config, event streaming will be disregarded in this case: {err:?}");
}
}
cc @onur-ozkan
I am fine with either way; I don't have strong opinions about this, but I would expect an app to fail initialization if it starts with incorrect configuration. When we make a breaking change in the configuration, as the logs can easily be missed, people should have their apps fail on start so they will be aware of the breaking change.