Sha256: ce70ab7ca9e39925edcef3180b85569df3e0681bcead7becda0104d0ab745718

Contents?: true

Size: 577 Bytes

Versions: 1

Compression:

Stored size: 577 Bytes

Contents

module WatCatcher
  class SidekiqMiddleware
    def call(worker, msg, queue)
      begin
        yield
      rescue => excpt
        raise if msg["class"] == WatCatcher::SidekiqPoster.to_s
        SidekiqPoster.perform_async(
            "#{WatCatcher.configuration.host}/wats",
            {
                wat: {
                    backtrace: excpt.backtrace.to_a,
                    message: excpt.message,
                    error_class: excpt.class.to_s,
                    sidekiq_msg: msg

                }
            })
        raise
      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wat_catcher-0.1.0 lib/wat_catcher/sidekiq_middleware.rb