rapid7/metasploit-framework — pull request #2228 by wchen-r7 (2013-08-15 17:14:49+00:00)
Title: Fix how fail_with() is used

fail_with() is a function in lib/msf/core/exploit.rb, which indicates that this is meant to be used only for exploit modules. Because of that, it should NOT be seen in places like a mixin or auxiliary modules, otherwise you will get a "NoMethodError undefined method `fail_with'" error - [See RM 8265] for example.

Instead of using fail_with(), the closest replacement for that is to fall back to raise Runtime, which is also something we used a lot before fail_with was created.