normalize

in lib/aws_lambda_ric/xray_cause.rb [23:41]


  def normalize(err:)
    exception = {
      message: err[:errorMessage],
      type: err[:errorType]
    }

    backtrace = err[:stackTrace]
    if backtrace
      exception[:stack] = backtrace.first(MAX_DEPTH).collect do |t|
        {
          path: t.path,
          line: t.lineno,
          label: t.label
        }
      end
    end
    [exception]
  end