Sha256: d65763c1d85f9e4e408fe777b18415b9fd9cac973c80a5b1808956ea0dfa4dd3

Contents?: true

Size: 499 Bytes

Versions: 42

Compression:

Stored size: 499 Bytes

Contents

module Sentry
  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

42 entries across 42 versions & 3 rubygems

Version Path
sentry-ruby-core-4.7.3 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.7.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.7.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.7.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.6.5 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.6.4 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.6.3 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.6.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.6.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.6.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.6.0.pre.beta.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.5.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.5.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.5.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.5.0.pre.beta.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.4.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.4.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.4.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.4.0.pre.beta.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-4.3.2 lib/sentry/utils/exception_cause_chain.rb