RubyFlow The Ruby and Rails community linklog

Avoid using exceptions for flow control

Why it’s a bad idea to use exception for flow control, and a short example based on devise’s code showing an alternative approach. http://jaszczurowski.com/avoid-using-exceptions-for-flow-control/

Comments

Thanks for posting this. I have seen some gems using exception + rescue as flow control Like interactor: https://github.com/collectiveidea/interactor/blob/master/lib/interactor/context.rb#L123 Now I write my own service classes instead of using that gem

I’m glad it was useful for you. :)

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in