Skip to content

How to add simple context to a Cut error? #584

Answered by epage
DavidAntliff asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, if directly constructing an error, rather than building on top of an existing error, this is the way to do it.

Ideally, you could do winnow::ascii::float.verify(|f| f.is_finite()).context(...) but then the context would apply to failures from winnow::ascii::float and when you only want it to apply to verify. #180 is the issue for this and I just don't have a good answer beyond writing imperative code like this.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@DavidAntliff
Comment options

@DavidAntliff
Comment options

@epage
Comment options

Answer selected by DavidAntliff
@DavidAntliff
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants