console.log displays it as follows:
{ [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' }
but JSON.stringify does not see the narrative of the error,
{"length": 86, "name": "error", "severity": "ERROR", "code": "42601", "position": "62", "file": "scan.l", " line ":" 1001 "," regular ":" scanner_yyerror "}
I cannot figure out how to get this "error: the column" undefined "does not exist" reading the wiki ( https://github.com/brianc/node-postgres/wiki/Error-handling , http://nodejs.ru/doc /v0.4.x/stdio.html#console.log )
The code is
client.query(selstring, function(err, result) {
if(err){
res.send(JSON.stringify(err));
console.log(err);
}else{
thank
UPDATE: err.toString() error: syntax error at or near "step"