module Staccato::ExceptionTracking

Public Class Methods

included(controller) click to toggle source
# File lib/staccato/exception_tracking.rb, line 4
def self.included(controller)
  controller.rescue_from ::Exception,
    with: :track_exception_with_staccato_and_raise
end

Public Instance Methods

track_exception_with_staccato(exception) click to toggle source
# File lib/staccato/exception_tracking.rb, line 9
def track_exception_with_staccato(exception)
  tracker.exception(description: exception.class.name)
end
track_exception_with_staccato_and_raise(exception) click to toggle source
# File lib/staccato/exception_tracking.rb, line 13
def track_exception_with_staccato_and_raise(exception)
  track_exception_with_staccato(exception)

  # re-raise the exception as normal
  raise exception
end