I'm quite enjoying mount-lite now :) I'm developing several services based on it, and I've encountered a minor issue.
When I write my unit tests, I sometimes start the application excluding some states that perform side effects (like accessing AWS). When I (erroneously) forget to mock some function that uses those states, the @ throws an ExceptionInfo "state xxx not started".
However, if that call is wrapped in a (try ... (catch Exception _)), this error does not propagate to the top level, hiding the error from the test runner.
I imagine that this could be easily solved by throwing Error (which does not inherit Exception, but Throwable). It also seems the right thing to do, as state configuration problems are always programmer's errors and are not meant to be caught like ExceptionInfo.
Here is my humble PR to implement this proposal. Please let me know what you think.
Hi Arnout,
I'm quite enjoying mount-lite now :) I'm developing several services based on it, and I've encountered a minor issue.
When I write my unit tests, I sometimes start the application excluding some states that perform side effects (like accessing AWS). When I (erroneously) forget to mock some function that uses those states, the
@
throws an ExceptionInfo "state xxx not started".However, if that call is wrapped in a
(try ... (catch Exception _))
, this error does not propagate to the top level, hiding the error from the test runner.I imagine that this could be easily solved by throwing
Error
(which does not inheritException
, butThrowable
). It also seems the right thing to do, as state configuration problems are always programmer's errors and are not meant to be caught likeExceptionInfo
.Here is my humble PR to implement this proposal. Please let me know what you think.
Thanks in advance.