Skip to content

Commit a0fa1a9

Browse files
author
Ludo Galabru
committed
fix: do not panic
1 parent 67cb340 commit a0fa1a9

File tree

1 file changed

+11
-3
lines changed
  • components/chainhook-cli/src/service

1 file changed

+11
-3
lines changed

components/chainhook-cli/src/service/mod.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,17 @@ fn load_predicates_from_redis(
363363
let mut predicates = vec![];
364364
for key in chainhooks_to_load.iter() {
365365
let chainhook = match redis_con.hget::<_, _, String>(key, "specification") {
366-
Ok(spec) => {
367-
ChainhookSpecification::deserialize_specification(&spec, key).unwrap()
368-
// todo
366+
Ok(spec) => match ChainhookSpecification::deserialize_specification(&spec, key) {
367+
Ok(spec) => spec,
368+
Err(e) => {
369+
error!(
370+
ctx.expect_logger(),
371+
"unable to load chainhook associated with key {}: {}",
372+
key,
373+
e.to_string()
374+
);
375+
continue;
376+
}
369377
}
370378
Err(e) => {
371379
error!(

0 commit comments

Comments
 (0)