Module: Yeller::Rails::Rails3AndFourCatchingHooks
- Defined in:
- lib/yeller/rails.rb
Class Method Summary collapse
Instance Method Summary collapse
- #_capture_exception(env, exception, extra = {}) ⇒ Object
- #render_exception_with_yeller(env, exception) ⇒ Object
- #report_exception_to_yeller(exception, extra = {}) ⇒ Object
Class Method Details
.included(base) ⇒ Object
78 79 80 81 |
# File 'lib/yeller/rails.rb', line 78 def self.included(base) base.send(:alias_method, :render_exception_without_yeller, :render_exception) base.send(:alias_method, :render_exception, :render_exception_with_yeller) end |
Instance Method Details
#_capture_exception(env, exception, extra = {}) ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/yeller/rails.rb', line 83 def _capture_exception(env, exception, extra={}) begin request = ::Rack::Request.new(env) controller = env['action_controller.instance'] if controller params = controller.send(:params) Yeller::Rack.report( exception, :url => request.url, :location => "#{controller.class.to_s}##{params[:action]}", :custom_data => controller._yeller_custom_data.merge(extra) ) else Yeller::VerifyLog.action_controller_instance_not_in_env! Yeller::Rack.rescue_rack_exception(exception, env) end rescue => e Yeller::VerifyLog.error_reporting_rails_error!(e) end end |
#render_exception_with_yeller(env, exception) ⇒ Object
109 110 111 112 113 |
# File 'lib/yeller/rails.rb', line 109 def render_exception_with_yeller(env, exception) Yeller::VerifyLog.render_exception_with_yeller! _capture_exception(env, exception) render_exception_without_yeller(env, exception) end |
#report_exception_to_yeller(exception, extra = {}) ⇒ Object
105 106 107 |
# File 'lib/yeller/rails.rb', line 105 def report_exception_to_yeller(exception, extra={}) _capture_exception(request.env, exception, extra) end |