class Sentry::ExceptionInterface

def self.build(exception:, stacktrace_builder:)

Returns:
  • (ExceptionInterface) -

Other tags:
    See: SingleExceptionInterface#initialize -
    See: SingleExceptionInterface#build_with_stacktrace -

Parameters:
  • stacktrace_builder (StacktraceBuilder) --
  • exception (Exception) --
def self.build(exception:, stacktrace_builder:)
  exceptions = Sentry::Utils::ExceptionCauseChain.exception_to_array(exception).reverse
  processed_backtrace_ids = Set.new
  exceptions = exceptions.map do |e|
    if e.backtrace && !processed_backtrace_ids.include?(e.backtrace.object_id)
      processed_backtrace_ids << e.backtrace.object_id
      SingleExceptionInterface.build_with_stacktrace(exception: e, stacktrace_builder: stacktrace_builder)
    else
      SingleExceptionInterface.new(exception: exception)
    end
  end
  new(exceptions: exceptions)
end