Skip to content
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

Return errors instead of throwing Exception #31

Open
nemec opened this issue Aug 27, 2016 · 4 comments
Open

Return errors instead of throwing Exception #31

nemec opened this issue Aug 27, 2016 · 4 comments

Comments

@nemec
Copy link
Owner

nemec commented Aug 27, 2016

It's expected that, at some point, a user will add invalid input. Instead of throwing exceptions we should force the dev to handle them as part of parsing.

@JVimes
Copy link

JVimes commented Oct 4, 2016

Definitely agree. I don't like using exceptions for control flow.

@nemec
Copy link
Owner Author

nemec commented Jan 29, 2017

@JVimes if you're using this library, feel free to check out the new 2.0 branch. I just checked in code removing all thrown Exceptions. You now have a pattern-matching-esque return value where parsing success and failure are explicitly handled in code.

If you get a chance to try it out, let me know if you have any feedback. 2.0 is going to contain many breaking changes, so I want to make sure it's designed as well as it can be (and not "best we can do with backwards compatibility" 😀)

@JVimes
Copy link

JVimes commented Jan 30, 2017

@nemec, thanks! Took 2.0 for a spin w/ReadMe sample code. It fixes this issue for me, nicely. Only minor suggestions: update sample code to compile when pasted into blank Console Application (Assert.Fail() not found); and maybe link to the installer for .NET Core Tools in a "developer notes" section, somewhere. Thanks, again!

@nemec
Copy link
Owner Author

nemec commented Jan 30, 2017

Shoot, I converted the sample to a unit test so I'd know whenever I broke the sample code, but now I've gone and copied that unit test back into the sample without cleaning it up 😛

Good suggestions, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants