You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the context of the RPC system, I agree that ErrorKind::Disconnect seems appropriate for this sort of error. But what if the (truncated) message is being read from disk? ErrorKind::Disconnect seems inappropriate in that case.
Maybe what we should really be doing is looking into wrapping errors more faithfully, as e.g. the failure crate might allow us to do.
What would ErrorKind::Disconnect mean when reading from disk? That the file was deleted?
I've been using snafu lately, and been enjoying it, but you can avoid pulling in an external crate if all you want to do is wrap the error type: just add a variant with the error type and implement std::error::Error.
I've added a try_read_message() function in 18c2e0c. The idea is that you can call this function in a loop and stop when it return None, which means EOF. Does that address your concern?
I'm no longer working on the project using this crate, but @JoelScarfone will probably have an opinion.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After the other end of a unix domain socket or a pipe disconnects, calls to
read_exactwill return anUnexpectedEoferror.I believe that this should be treated as an
ErrorKind::Disconnectand not a genericErrorKind::Failure.