collectiveidea / interactor

Interactor provides a common interface for performing complex user interactions.
MIT License
3.36k stars 212 forks source link

Friendly error message when calling interactor with non-hash arguments #178

Open taylorthurlow opened 4 years ago

taylorthurlow commented 4 years ago

If I call an interactor like so:

MyInteractor.call(something)

rather than the correct:

MyInteractor.call(something: "something")

Then I get a semi-cryptic error like:

NoMethodError:
       undefined method `each_pair' for #<MyInteractor:0x00007fa2fc407350>

It's pretty easy to see that I just called the interactor incorrectly, but it seems like it would be easy to check the provided parameters and raise a helpful error.