zapnap/resque_mailer — pull request #41 by sshanker220 (2012-10-13 02:01:51+00:00)
Title: raise the previous exception instead of instantiating it again

This pull request resolves Issue 40.

The problem here was that in the following line (49)

raise ex.class, "Unable to deliver email: [#{ex.message}]", ex.backtrace

the exception passed through was being instantiated again. Now, in the case of an ActionView::Template::Error, not enough arguments are being passed through in order to instantiate the exception object correctly,so the error

ArgumentError: wrong number of arguments (1 for 3) was being thrown

simply reraising the exception object solves this problem and displays the correct error that was thrown in the view (for example a no method error).