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-core-5.17.3 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.17.3 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.17.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.17.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.17.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.17.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.17.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.17.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.16.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.16.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.16.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.16.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.15.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.15.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.15.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.15.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.15.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.15.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.14.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.14.0 lib/sentry/utils/exception_cause_chain.rb