record db timeouts in newrelic
This commit is contained in:
@@ -33,6 +33,10 @@ protected
|
||||
@exception = exception
|
||||
|
||||
if exception.is_a?(::ActiveRecord::StatementInvalid) && exception.to_s =~ /statement timeout/
|
||||
if Rails.env.production?
|
||||
NewRelic::Agent.notice_error(exception, :uri => request.request_uri, :referer => request.referer, :request_params => params, :custom_params => {:user_id => CurrentUser.user.id, :user_ip_addr => CurrentUser.ip_addr})
|
||||
end
|
||||
|
||||
@error_message = "The database timed out running your query."
|
||||
render :template => "static/error", :status => 500
|
||||
elsif exception.is_a?(::ActiveRecord::RecordNotFound)
|
||||
|
||||
Reference in New Issue
Block a user