You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Version 3, context.fail! always throws an exception:
# Raises Interactor::Failure initialized with the Interactor::Context.deffail!(context={})modifiable.update(context)@failure=trueraiseFailure,selfend
In version 2, it did not. The README is still showing the version 2 behaviour, where the caller queries success? after.
What is the current best practice to indicate and respond to failure? I liked the old idiom of checking context.success? from the controller, after the interactor has returned. Yet now it seems we must rescue instead - a change that disrupts the structure of the controller methods.
Could we provide a non-throwing 'fail' method in addition to the throwing version? (I'm currently using a Rails initializer to monkey-patch one in).
The text was updated successfully, but these errors were encountered:
In Version 3, context.fail! always throws an exception:
In version 2, it did not. The README is still showing the version 2 behaviour, where the caller queries success? after.
What is the current best practice to indicate and respond to failure? I liked the old idiom of checking context.success? from the controller, after the interactor has returned. Yet now it seems we must rescue instead - a change that disrupts the structure of the controller methods.
Could we provide a non-throwing 'fail' method in addition to the throwing version? (I'm currently using a Rails initializer to monkey-patch one in).
The text was updated successfully, but these errors were encountered: