Skip to content

Instantly share code, notes, and snippets.

@samvermette
Created July 20, 2012 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samvermette/3149287 to your computer and use it in GitHub Desktop.
Save samvermette/3149287 to your computer and use it in GitHub Desktop.
rescue_from Exception, :with => :mail_exception
def mail_exception(exception)
mail = Mail.new do
from 'Rescuer (domain.com) <rescuer@domain.com>'
to 'user@domain.com'
subject exception.inspect
body exception.backtrace[0..10].join("\n")
end
mail.delivery_method :sendmail
mail.deliver
raise exception
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment