Sha256: 64c2c6c530c45567ec2af7fe0076920d70734b3c761bb7d464d986bd32c83124

Contents?: true

Size: 497 Bytes

Versions: 12

Compression:

Stored size: 497 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

12 entries across 12 versions & 1 rubygems

Version Path
sentry-raven-3.0.0 lib/raven/utils/exception_cause_chain.rb
sentry-raven-2.13.0 lib/raven/utils/exception_cause_chain.rb
sentry-raven-2.12.3 lib/raven/utils/exception_cause_chain.rb
sentry-raven-2.12.2 lib/raven/utils/exception_cause_chain.rb
sentry-raven-2.12.1 lib/raven/utils/exception_cause_chain.rb
sentry-raven-2.12.0 lib/raven/utils/exception_cause_chain.rb
sentry-raven-2.11.3 lib/raven/utils/exception_cause_chain.rb
sentry-raven-2.11.2 lib/raven/utils/exception_cause_chain.rb
sentry-raven-2.11.1 lib/raven/utils/exception_cause_chain.rb
sentry-raven-2.11.0 lib/raven/utils/exception_cause_chain.rb
sentry-raven-2.10.0 lib/raven/utils/exception_cause_chain.rb
sentry-raven-2.9.0 lib/raven/utils/exception_cause_chain.rb