diff --git a/packages/api/src/proc/sessionProcess.js b/packages/api/src/proc/sessionProcess.js index 91800d7c..459e934f 100644 --- a/packages/api/src/proc/sessionProcess.js +++ b/packages/api/src/proc/sessionProcess.js @@ -156,7 +156,7 @@ class StreamHandler { this.resolve(); } info(info) { - if (info.line != null) { + if (info && info.line != null) { info = { ...info, line: this.startLine + info.line, @@ -168,7 +168,8 @@ class StreamHandler { function handleStream(driver, resultIndexHolder, sqlItem) { return new Promise((resolve, reject) => { - const handler = new StreamHandler(resultIndexHolder, resolve, sqlItem.trimStart.line); + const start = sqlItem.trimStart || sqlItem.start; + const handler = new StreamHandler(resultIndexHolder, resolve, start && start.line); driver.stream(systemConnection, sqlItem.text, handler); }); } diff --git a/packages/web/src/query/SocketMessageView.svelte b/packages/web/src/query/SocketMessageView.svelte index 74686375..5e1bddf4 100644 --- a/packages/web/src/query/SocketMessageView.svelte +++ b/packages/web/src/query/SocketMessageView.svelte @@ -49,7 +49,7 @@ $: { if (onChangeErrors) { - const errors = displayedMessages.filter(x => x.severity == 'error'); + const errors = displayedMessages.filter(x => x.severity == 'error' && x.line != null); if (lastErrorMessageCountRef.get() != errors.length) { onChangeErrors( errors.map(err => ({ diff --git a/plugins/dbgate-plugin-sqlite/src/backend/driver.js b/plugins/dbgate-plugin-sqlite/src/backend/driver.js index 7258d18b..1e4ee9e3 100644 --- a/plugins/dbgate-plugin-sqlite/src/backend/driver.js +++ b/plugins/dbgate-plugin-sqlite/src/backend/driver.js @@ -104,10 +104,10 @@ const driver = { inTransaction(); } catch (error) { console.log('ERROR', error); - const { message, lineNumber, procName } = error; + const { message, procName } = error; options.info({ message, - line: lineNumber, + line: 0, procedure: procName, time: new Date(), severity: 'error',