UNPKG

postgrejs

Version:

Professional PostgreSQL client NodeJS

30 lines (29 loc) 559 B
export class DatabaseError extends Error { severity; code; detail; hint; position; internalPosition; internalQuery; where; schema; table; column; dataType; constraint; lineNr; colNr; line; constructor(msg) { super(msg.message); Object.assign(this, { ...msg, line: undefined, file: undefined, routine: undefined, }); if (msg.position) this.position = parseInt(msg.position, 10) || undefined; } }