Skip to content

Commit

Permalink
Update README.md part about handling exceptions
Browse files Browse the repository at this point in the history
A small change in README.md which makes a part about exception swallowing more precise.
  • Loading branch information
ocher authored Nov 2, 2021
1 parent 57b2af9 commit 2c33601
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ context.success? # => false

Normally, however, these exceptions are not seen. In the recommended usage, the controller invokes the interactor using the class method `call`, then checks the `success?` method of the context.

This works because the `call` class method swallows exceptions. When unit testing an interactor, if calling custom business logic methods directly and bypassing `call`, be aware that `fail!` will generate such exceptions.
This works because the `call` class method swallows `Interactor::Failure` exceptions. When unit testing an interactor, if calling custom business logic methods directly and bypassing `call`, be aware that `fail!` will generate such exceptions.

See *Interactors in the Controller*, below, for the recommended usage of `call` and `success?`.

Expand Down

0 comments on commit 2c33601

Please sign in to comment.