def unwrap_causes(cause)
      causes, c, i = [], cause, 0

      while c && i < MAX_EXCEPTION_CAUSES
        causes << {
          class: c.class.name,
          message: c.message,
          backtrace: parse_backtrace(c.backtrace || caller)
        }
        i += 1
        c = exception_cause(c)
      end

      causes
    end
def unwrap_causes(cause)
      causes, c, i = [], cause, 0

      while c && i < MAX_EXCEPTION_CAUSES
        causes << {
          class: c.class.name,
          message: c.message,
          backtrace: parse_backtrace(c.backtrace || caller)
        }
        i += 1
        c = exception_cause(c)
      end

      causes
    end
Create a list of causes.

 cause - The first cause to unwrap.

 Returns Array causes (in Hash payload format).