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
Comments
Definitely agree. I don't like using exceptions for control flow. |
@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" 😀) |
@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! |
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. |
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.
The text was updated successfully, but these errors were encountered: