class Airbrake::NestedException

@since v1.0.4
@api private
as JSON-like hash.
A class that is capable of unwinding nested exceptions and representing them

def as_json

def as_json
  unwind_exceptions.map do |exception|
    { type: exception.class.name,
      message: exception.message,
      backtrace: Backtrace.parse(exception) }
  end
end

def initialize(exception)

def initialize(exception)
  @exception = exception
end

def unwind_exceptions

def unwind_exceptions
  exception_list = []
  exception = @exception
  while exception && exception_list.size < MAX_NESTED_EXCEPTIONS
    exception_list << exception
    exception = (exception.cause if exception.respond_to?(:cause))
  end
  exception_list
end