News for hackers. Stuff that matters.
Re:Replacing Throwing Exceptions with Notification in Valida... by striking on Saturday December 13, 2014 @05:20PM (#8746680)
Interesting. In my validator [1], I take an entirely different approach. Everything throws an exception... which is caught and rethrown at every level, which you can then "interrogate."

I did it this way because if someone calls the validation function and wants the method to fail immediately if something is wrong, it will. No need to check, it just does. But if you'd like to try validating and see if something messes up, you can!

[1]: https://github.com/callmeStriking/affirm-json (see src/validator.js or, heck, just run lib/valitest.js)

There are no comments on this comment yet.