fixes + sqlite error line number

This commit is contained in:
Jan Prochazka 2022-09-25 20:06:34 +02:00
parent 7781ad69cf
commit 2b26779ea8
3 changed files with 6 additions and 5 deletions

View File

@ -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);
});
}

View File

@ -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 => ({

View File

@ -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',