Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Howto Send Email When Rails Throws An Exception

Add the following to your application.rb:

  protected  

  def log_error(exception) 
    super(exception)

    begin
      ErrorMailer.deliver_snapshot(
        exception, 
        clean_backtrace(exception), 
        @session.instance_variable_get("@data"), 
        @params, 
        @request.env)
    rescue => e
      logger.error(e)
    end
  end


Taken from http://wiki.rubyonrails.com/rails/show/HowtoSendEmailWhenRailsThrowsAnException
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed