console.log 像这样输出它,
{ [error: syntax error at or near "step"]
length: 86,
name: 'error',
severity: 'ERROR',
code: '42601',
detail: undefined,
hint: undefined,
position: '62',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
file: 'scan.l',
line: '1001',
routine: 'scanner_yyerror' }
但 JSON.stringify 没有看到错误的叙述部分,
{"length":86,"name":"error","severity":"ERROR","code":"42601","position":"62","file":"scan.l","行":"1001","例程":"scanner_yyerror"}
我不知道如何在阅读维基(https://github.com/brianc/node-postgres/wiki/Error-handling,http://nodejs . ru/doc/v0.4.x/stdio.html#console.log)
代码是这样的,
client.query(selstring, function(err, result) {
if(err){
res.send(JSON.stringify(err));
console.log(err);
}else{
谢谢
更新:err.toString()
显示error: syntax error at or near "step"