packages/logger/lib/serializers.js
function errorSerializer (err) {
  if (!err || !err.stack) return err
  const obj = {
    message: err.message,
    name: err.name,
    code: err.code,
    stack: getErrorStack(err)
  }
  return obj
}
function errorSerializer (err) {
  if (!err || !err.stack) return err
  const obj = {
    message: err.message,
    name: err.name,
    code: err.code,
    stack: getErrorStack(err)
  }
  return obj
}
function errorSerializer ( err ) { if ( ! err || ! err . stack ) return err const obj = { message : err . message , name : err . name , code : err . code , stack : getErrorStack ( err ) } return obj }
Serializes Error Objects

@type {import("pino").SerializerFn}
@param  {any} err
Serializes Error Objects