Sha256: 0691e6782f57e6fd8b99924903be0302d358deaa5e6aa23103b848c282b11af0

Contents?: true

Size: 489 Bytes

Versions: 2

Compression:

Stored size: 489 Bytes

Contents

module Staccato
  module ExceptionTracking

    def self.included(controller)
      controller.rescue_from ::Exception,
        with: :track_exception_with_staccato_and_raise
    end

    def track_exception_with_staccato(exception)
      tracker.exception(description: exception.class.name)
    end

    def track_exception_with_staccato_and_raise(exception)
      track_exception_with_staccato(exception)

      # re-raise the exception as normal
      raise exception
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
staccato-rails-0.1.0 lib/staccato/exception_tracking.rb
staccato-rails-0.0.1 lib/staccato/exception_tracking.rb