节点发布错误对象的第一个“属性”

First 'property' of node-postgres error object

本文关键字:第一个 属性 对象 布错误 错误 节点      更新时间:2023-09-26

>有人知道错误查询中错误对象中的第一个伪属性是什么吗? 当我console.log('' + error);时,它会抓取括号内的文本以显示。 除此之外,我不确定如何引用该属性。

{ [error: function XXXXXXXXXX does not exist]
   name: 'error',
   length: 226,
   severity: 'ERROR',
   code: '42883',
   detail: undefined,
   hint: 'No function matches the given name and argument types. You might need to add explicit type casts.',
   position: '8',
   internalPosition: undefined,
   internalQuery: undefined,
   where: undefined,
   file: 'parse_func.c',
   line: '306',
   routine: 'ParseFuncOrColumn' }

属性message将允许您访问错误消息本身。