Sha256: ce938ec836989803c64cf8337de4db2b1d7827bedb8d7f1a36e40a1e239d3f48

Contents?: true

Size: 444 Bytes

Versions: 4

Compression:

Stored size: 444 Bytes

Contents

require 'active_support/concern'

module WatCatcher
  module CatcherOfWats
    extend ActiveSupport::Concern

    included do
      around_filter :catch_wats
    end

    def wat_user
      current_user
    end

    def catch_wats(&block)
      block.call
    rescue Exception => e
      user = nil
      begin
        user = wat_user
      rescue;end
      WatCatcher::Report.new(e, user: user, request: request)
      raise
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wat_catcher-0.5.3 app/controllers/concerns/wat_catcher/catcher_of_wats.rb
wat_catcher-0.5.2 app/controllers/concerns/wat_catcher/catcher_of_wats.rb
wat_catcher-0.5.1 app/controllers/concerns/wat_catcher/catcher_of_wats.rb
wat_catcher-0.5.0 app/controllers/concerns/wat_catcher/catcher_of_wats.rb