
27 Nov
2012
27 Nov
'12
12:48 p.m.
* Simon Hengel
Please don't get me wrong. Personally I always prefer pattern matching over /exception throwing functions/. However, I still think making it hard to "deal" with exception throw function is the wrong approach.
Regarding testing: Failure behavior is part of the public interface of a function. If a function throws an exception (whether I like it or not), I'd like to have it documented. The best way to document something is a test case (IMHO).
Isn't the person who writes tests usually the same as the person who writes the code which is being tested? So, if writing tests for ErrorCall is inconvenient, that would (hopefully) encourage people to write their own, meaningful, exceptions. Roman