-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Builder::try_parse()
method
#324
Merged
Merged
Conversation
This file contains 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
epage
reviewed
Jul 18, 2024
epage
reviewed
Jul 18, 2024
epage
reviewed
Jul 18, 2024
Pull Request Test Coverage Report for Build 10060325859Details
💛 - Coveralls |
epage
reviewed
Jul 18, 2024
epage
reviewed
Jul 18, 2024
Maximkaaa
commented
Jul 19, 2024
epage
reviewed
Jul 19, 2024
epage
reviewed
Jul 19, 2024
epage
reviewed
Jul 19, 2024
epage
reviewed
Jul 19, 2024
Thanks for moving this forward! |
I fixed all the comments except the last one, since I think that the current approach is better. If you insist on returning just one error string, I will edit it also. |
epage
reviewed
Jul 22, 2024
Looks like the final commit needs |
Current implementation of the Builder::parse() method prints out specification errors to stderr and then just ignores them. This is fine for most console applications, but in some cases better control over what is happening is needed: * Sometimes there is no access to stderr, in that case there is no way to find out what went wrong. * For some applications it's more desirable to fail on startup than to run with (partially) invalid configuration. For such cases this commit introduces a new method try_parse that does the same thing as the parse method, but returns an Err in case an error in the specification is found.
Done. |
Thanks! This is now released. |
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.
Current implementation of the
Builder::parse()
method prints out specification errors tostderr
and then just ignores them. This is fine for most console applications, but in some cases better control over what is happening is needed:stderr
, in that case there is no way to find out what went wrongFor such cases this PR introduces a new method
try_parse
that does the same thing as theparse
method, but returns anErr
in case an error in the specification is found.This change was suggested in and fixes #323.