Closed hedgesky closed 7 years ago
Version 4.0 will use throw
and catch
rather than raise
and rescue
for this very reason. My attention is turning to development of 4.0, but I would be happy to merge a readme update with a brief mention of context.fail!
's internal behavior and a warning that using a blanket rescue
in your interactor may swallow the failure.
Currently
context.fail!
raises an error but there is no mention about that in Readme. Therefore a user could accidentally rescue these errors. Example:Here user tries to log unforeseen errors but instead finds such lines:
From my point of view, we should at least add information about that in README with possible solution:
But ideal solution is using
throw
instead ofraise
. It would stop execution (likeraise
does) and wouldn't require additionalrescues
. I can make a PR if you find this solution is acceptable.