Sha256: 3e6afea2ef3dae19d14752ffd3d5e6e1c45fce0cfe84ccf5ed8621ba08e46c3e

Contents?: true

Size: 983 Bytes

Versions: 5

Compression:

Stored size: 983 Bytes

Contents

# encoding: utf-8

module TingYun
  module Agent
    class Transaction
      class Exceptions
        attr_accessor :exceptions

        def initialize
          @exceptions = {}
        end

        def record_exceptions(attributes)
          unless @exceptions.empty?
            @exceptions.each do |exception, options|
              options[:attributes]      = attributes
              ::TingYun::Agent.instance.error_collector.notice_error(exception, options)
            end
          end
        end

        # Do not call this.  Invoke the class method instead.
        def notice_error(error, options={}) # :nodoc:
          if @exceptions[error]
            @exceptions[error].merge! options
          else
            @exceptions[error] = options
          end
        end

        #collector error
        def had_error?
          if @exceptions.empty?
            return false
          else
            return true
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tingyun_rpm-1.4.2 lib/ting_yun/agent/transaction/exceptions.rb
tingyun_rpm-1.4.1 lib/ting_yun/agent/transaction/exceptions.rb
tingyun_rpm-1.3.1 lib/ting_yun/agent/transaction/exceptions.rb
tingyun_rpm-1.3.0 lib/ting_yun/agent/transaction/exceptions.rb
tingyun_rpm-1.2.0 lib/ting_yun/agent/transaction/exceptions.rb