Make hiffy_decode return a non-nested error#661
Open
mkeeter wants to merge 1 commit into
Open
Conversation
e0a515b to
2dea381
Compare
70f547e to
02dc755
Compare
2dea381 to
861ffd1
Compare
02dc755 to
27e0c3a
Compare
861ffd1 to
c3de5fa
Compare
27e0c3a to
1e0ed19
Compare
c3de5fa to
e66628c
Compare
1e0ed19 to
a35dcb6
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
(staged on #660)
hiffy_decodereturns aResult<std::result::Result<T, String>>, which is an awkward type.We can instead use the
HiffyCallError(renamedHiffyError), which distinguishes between internal errors (returned by the HIF program) and external errors (which occur when calling hiffy).This simplifies most cases (where we want to return both inner and outer error), and adds a tiny bit of boilerplate to cases where we care about the difference – but that boilerplate is more clear than the nested type.