Created
May 14, 2012 14:40
-
-
Save modsaid/2694370 to your computer and use it in GitHub Desktop.
Revisions
-
modsaid created this gist
May 14, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #To be placed in application_controller.rb rescue_from Exception, :with => :rescue_all_exceptions unless %W(development test).include?(Rails.env) def rescue_all_exceptions(exception) buffer = "[EXCEPTION] " buffer << exception.message << "\t(Request: #{request.url}\t Referrer: (#{request.env['HTTP_REFERER']} ) \n\t" buffer << exception.backtrace.join("\n\t") Rails.logger.error buffer respond_to do |format| format.html { redirect_to '/500.html'} format.js { render :nothing => true, :status => 500 } end end