Skip to content

Commit

Permalink
Merge pull request #201 from ocher/patch-1
Browse files Browse the repository at this point in the history
Update README.md part about handling exceptions
  • Loading branch information
gaffneyc authored Dec 28, 2024
2 parents 0b4dee9 + 2c33601 commit a5f0a20
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 a5f0a20

Please sign in to comment.