Closed dan-da closed 1 year ago
@racs4 I added a kindelia_core::util::FileSystemError. The purpose is to wrap std::io::Error for any filesystem calls, so that path and optionally context can be reported to the user.
Otherwise the user gets "write failed os error(27)" type errors, without even knowing the file. This is a pain point in rust, and it seems like they might address it soon. see https://github.com/rust-lang/rfcs/issues/2885
The new error type enables SimpleFileStorage to return rich errors cleanly, as path info does not necessarily belong in BlockStorageError.
It should also be useful for other places that presently return IoResult, for example. Basically any code that interacts with filesystem.
Also, I notice that if a review has been requested and not yet performed and then another commit is pushed, CI does not run. And there is no way to request another review.
I found that a workaround is to convert the PR to a draft and then back to a regular PR, at which point checks run again.
I notice that if a review has been requested and not yet performed and then another commit is pushed, CI does not run.
I will try to fix this.
Addresses #247. (more to come)
This PR focuses on persistence.rs. Modifications to other files are just to handle the persistence changes.
persistence.rs:
node.rs:
add NodeError enum (beginning. more variants to come)
log errors from BlockStorage read, write
minor tweaks in main.rs to handle above changes.