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.22.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.22.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.22.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.22.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.22.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.22.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.21.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.21.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.20.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.20.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.20.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.20.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.19.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.19.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.18.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.18.2 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.18.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.18.1 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-5.18.0 lib/sentry/utils/exception_cause_chain.rb
sentry-ruby-core-5.18.0 lib/sentry/utils/exception_cause_chain.rb