mutations icon indicating copy to clipboard operation
mutations copied to clipboard

Add the "failure?" method to the outcome

Open ryanfaerman opened this issue 10 years ago • 3 comments

The failure? method helps consumers of the mutations add some clarity.

Sometimes after a mutation, you really just want to recover gracefully on failure and I've found myself with plenty of code resembling the following:

mutation = SomeMutationClass.run(some_params)
unless mutation.success?
  # do something to recover, like attempt something else
end

Having the failure? method makes things just a little clearer since the code can now ask if failure?.

ryanfaerman avatar Jul 22 '14 00:07 ryanfaerman

Would be a nice addition, +1

anicholson avatar Jul 22 '14 03:07 anicholson

It looks like the build failed on this primarily because the rbx ruby target is not running properly.

ryanfaerman avatar Jul 22 '14 12:07 ryanfaerman

This does look like it would be useful - sorry it sat unacknowledged for so long 😔

Would you be interested in rebasing this and resolving the conflicts so that I can merge it?

eugeneius avatar Oct 24 '18 20:10 eugeneius