node-pg-error
node-pg-error copied to clipboard
22P02 errors could use more detail
I'm not sure if this is a bug in parsing, or if PG just doesn't give the data, but 22P02
errors could use more detail. An example:
error: invalid input syntax for integer: "I should be an int!"
at …
name: 'error',
length: 85,
severity: 'ERROR',
code: '22P02',
detail: undefined,
hint: undefined,
position: '118',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'int8.c',
line: '99',
routine: 'scanint8',
It would be great if more detail like detail
, schema
, table
, column
, and dataType
were available.
Hey,
When you print out what the internal parse
function returns, does that contain more info?
https://github.com/moll/node-pg-error/blob/c594e7c73c2f47a7994c7136382125ca948a2893/index.js#L43
If not, then I'm afraid there's nothing we can do but ask Pg to add more information to its errors.