fix: do not panic

This commit is contained in:
Ludo Galabru
2023-04-13 12:05:06 -04:00
parent 67cb340674
commit a0fa1a9301

View File

@@ -363,9 +363,17 @@ fn load_predicates_from_redis(
let mut predicates = vec![];
for key in chainhooks_to_load.iter() {
let chainhook = match redis_con.hget::<_, _, String>(key, "specification") {
Ok(spec) => {
ChainhookSpecification::deserialize_specification(&spec, key).unwrap()
// todo
Ok(spec) => match ChainhookSpecification::deserialize_specification(&spec, key) {
Ok(spec) => spec,
Err(e) => {
error!(
ctx.expect_logger(),
"unable to load chainhook associated with key {}: {}",
key,
e.to_string()
);
continue;
}
}
Err(e) => {
error!(