Fantom-foundation / lachesis-rs

Lachesis BFT consensus for permission-less networks, in Rust
MIT License
34 stars 5 forks source link

Replace unwrap() with percolated error handling #39

Closed SamuelMarks closed 5 years ago

SamuelMarks commented 5 years ago

Closes #24

AgustinCB commented 5 years ago

You should use failure::Error as the return type, otherwise if there's a function call to a function returning a different error type, we won't be able to use ?

SamuelMarks commented 5 years ago

I've ignored a bunch of errors, because I was thinking that we don't want nodes to crash. Not sure if you want to use the log crate or similar to actually log the error before ignoring it in the next iterator functor.

I didn't remove the unwraps within the test modules or main functions, because I think it's fine for panics to happen here.

Not sure how to remove the unwrap from threads.

Currently debugging the last few remaining compilation errors, then ready for @AgustinCB to review.

AgustinCB commented 5 years ago

We already use log, so feel free to log them or open a new issue to handle that

AgustinCB commented 5 years ago

Let me know guys when is this ready for review

SamuelMarks commented 5 years ago

@AgustinCB can you merge this? - The rest of the codebase will move too far in the wrong direction without this.