Sha256: 6ff3381e0060e2f7969642c475fcc45189da22e47673b840a00e9cb3df9164ac

Contents?: true

Size: 498 Bytes

Versions: 7

Compression:

Stored size: 498 Bytes

Contents

module Raven
  module Utils
    module ExceptionCauseChain
      def self.exception_to_array(exception)
        if exception.respond_to?(:cause) && exception.cause
          exceptions = [exception]
          while exception.cause
            exception = exception.cause
            break if exceptions.any? { |e| e.object_id == exception.object_id }

            exceptions << exception
          end
          exceptions
        else
          [exception]
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sentry-raven-3.1.2 lib/raven/utils/exception_cause_chain.rb
sentry-raven-3.1.1 lib/raven/utils/exception_cause_chain.rb
sentry-raven-3.1.0 lib/raven/utils/exception_cause_chain.rb
sentry-raven-3.0.4 lib/raven/utils/exception_cause_chain.rb
sentry-raven-3.0.3 lib/raven/utils/exception_cause_chain.rb
sentry-raven-3.0.2 lib/raven/utils/exception_cause_chain.rb
sentry-raven-3.0.1 lib/raven/utils/exception_cause_chain.rb