mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
sql error line number - postgres
This commit is contained in:
parent
1a7f06342f
commit
7781ad69cf
@ -147,10 +147,14 @@ const drivers = driverBases.map(driverBase => ({
|
||||
|
||||
query.on('error', error => {
|
||||
console.log('ERROR', error);
|
||||
const { message, lineNumber, procName } = error;
|
||||
const { message, position, procName } = error;
|
||||
let line = null;
|
||||
if (position) {
|
||||
line = sql.substring(0, parseInt(position)).replace(/[^\n]/g, '').length;
|
||||
}
|
||||
options.info({
|
||||
message,
|
||||
line: lineNumber,
|
||||
line,
|
||||
procedure: procName,
|
||||
time: new Date(),
|
||||
severity: 'error',
|
||||
|
Loading…
Reference in New Issue
Block a user