Sha256: af4ca690087a6c18fe55e0a9912ecf870034241b59fe3eef822a3b14a1e1b711

Contents?: true

Size: 411 Bytes

Versions: 78

Compression:

Stored size: 411 Bytes

Contents

# frozen_string_literal: true

module Sentry
  module Utils
    module ExceptionCauseChain
      def self.exception_to_array(exception)
        exceptions = [exception]

        while exception.cause
          exception = exception.cause
          break if exceptions.any? { |e| e.object_id == exception.object_id }

          exceptions << exception
        end

        exceptions
      end
    end
  end
end

Version data entries

78 entries across 78 versions & 2 rubygems

Version Path
sentry-ruby-5.13.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.13.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.12.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.12.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.11.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.11.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.10.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.10.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.9.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.9.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.8.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.8.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.7.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.7.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.6.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.6.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.5.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.5.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.4.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.4.2 lib/sentry/utils/exception_cause_chain.rb