normalize_exception

in lib/aws-xray-sdk/model/cause.rb [47:68]


    def normalize_exception(e:, remote: false)
      h = {
        message: e.to_s,
        type:    e.class.to_s
      }
      h[:remote] = true if remote

      backtrace = e.backtrace_locations
      return h unless backtrace
      h[:stack] = backtrace.first(@@depth).collect do |t|
        {
          path:  t.path,
          line:  t.lineno,
          label: t.label
        }
      end

      truncated = backtrace.size - @@depth
      h[:truncated] = truncated if truncated > 0
      h
    end