Skip to content

Instantly share code, notes, and snippets.

@stubotnik
Created November 22, 2012 13:58
Show Gist options
  • Select an option

  • Save stubotnik/4131296 to your computer and use it in GitHub Desktop.

Select an option

Save stubotnik/4131296 to your computer and use it in GitHub Desktop.
error do
begin
# save error to DB
rescue => ex
mail_from = settings.email_settings[:default_sender]
mail_to = settings.email_settings[:errors_recipient]
Mail.deliver do
from mail_from
to mail_to
subject "Error saving exception to database #{ex.to_s}"
body ex.backtrace.join('\n')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment