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(@config, exception) } end end
def initialize(config, exception)
def initialize(config, exception) @config = config @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