Browse Source
398: Don't fail for loops r=da-kami a=da-kami We should not fail for loops where we loop over cfds to process state updates based on information we learned / restart. We use a macro to wrap all fallible code in the loop to just print an error and continue. Note: I went over the codebase in search of other for loops, maybe someone else can do another grep :) Co-authored-by: Daniel Karzel <daniel@comit.network>hotfix/0.1.1 0.1.0
bors[bot]
3 years ago
committed by
GitHub
4 changed files with 38 additions and 25 deletions
@ -0,0 +1,13 @@ |
|||
/// Wrapper for errors in loop that logs error and continues
|
|||
#[macro_export] |
|||
macro_rules! try_continue { |
|||
($result:expr) => { |
|||
match $result { |
|||
Ok(value) => value, |
|||
Err(e) => { |
|||
tracing::error!("{:#}", e); |
|||
continue; |
|||
} |
|||
} |
|||
}; |
|||
} |
Loading…
Reference in new issue