Sha256: 9e5753dca561ddac3223b23dd2b3efac7844692a9e51e63acac9b9785efb7965

Contents?: true

Size: 660 Bytes

Versions: 1

Compression:

Stored size: 660 Bytes

Contents

# encoding: utf-8

require 'raven'

module Adhearsion
  class Reporter
    class SentryNotifier
      include Singleton

      def init
        Raven.configure do |config|
          Reporter.config.sentry.to_hash.each do |k,v|
            config.send("#{k}=", v) unless v.nil?
          end
        end
      end

      def notify(ex)
        Raven.capture_exception(ex)
      rescue Exception => e
        logger.error "Error posting exception to Sentry"
        logger.warn "Original exception message: #{e.message}"
        raise
      end

      def self.method_missing(m, *args, &block)
        instance.send m, *args, &block
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adhearsion-reporter-2.3.1 lib/adhearsion/reporter/sentry_notifier.rb