Closed
Description
When an error is rejected from a query, then the stack trace is not complete. It does not include the calling code and that makes finding and fixing the errors harder than it needs to be. Could we not improve this in the module instead of having users add some wrapping try-catch logic to try to improve this?
**Sample of and error I just got"
error: operator does not exist: text = integer
at Parser.parseErrorMessage (/Users/aegiro/code/project/node_modules/pg-protocol/src/parser.ts:369:69)
at Parser.handlePacket (/Users/aegiro/code/project/node_modules/pg-protocol/src/parser.ts:188:21)
at Parser.parse (/Users/aegiro/code/project/node_modules/pg-protocol/src/parser.ts:103:30)
at Socket.<anonymous> (/Users/aegiro/code/project/node_modules/pg-protocol/src/index.ts:7:48)
at Socket.emit (events.js:400:28)
at addChunk (internal/streams/readable.js:290:12)
at readableAddChunk (internal/streams/readable.js:265:9)
at Socket.Readable.push (internal/streams/readable.js:204:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23) {
length: 200,
severity: 'ERROR',
code: '42883',
detail: undefined,
hint: 'No operator matches the given name and argument types. You might need to add explicit type casts.',
position: '295',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_oper.c',
line: '731',
routine: 'op_error'
}
Metadata
Metadata
Assignees
Labels
No labels