function getErrorProperties()

in packages/rum-core/src/error-logging/error-logging.js [38:68]


function getErrorProperties(error) {
  /**
   * Flag which is used to eliminate the empty object
   * check on context.custom
   */
  let propertyFound = false
  const properties = {}
  Object.keys(error).forEach(function (key) {
    if (IGNORE_KEYS.indexOf(key) >= 0) {
      return
    }
    /**
     * ignore null, undefined, function values
     */
    let val = error[key]
    if (val == null || typeof val === 'function') {
      return
    }

    if (typeof val === 'object') {
      if (typeof val.toISOString !== 'function') return
      val = val.toISOString()
    }
    properties[key] = val
    propertyFound = true
  })

  if (propertyFound) {
    return properties
  }
}