This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Showing
4 changed files
with
38 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} | ||
}; | ||
} |