1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00

fix error handling for web worker in Firefox #27

This commit is contained in:
lana-k
2021-04-24 16:53:19 +02:00
parent a7ef152140
commit 24411ac18f
2 changed files with 4 additions and 4 deletions

View File

@@ -59,7 +59,7 @@ class Database {
})
if (result.error) {
throw result.error
throw new Error(result.error)
}
return await this.getSchema(name)
@@ -70,7 +70,7 @@ class Database {
const res = await this.pw.postMessage({ action: 'open', buffer: fileContent })
if (res.error) {
throw res.error
throw new Error(res.error)
}
return this.getSchema(file.name)
@@ -103,7 +103,7 @@ class Database {
const results = await this.pw.postMessage({ action: 'exec', sql: commands })
if (results.error) {
throw results.error
throw new Error(results.error)
}
// if it was more than one select - take only the last one
return results[results.length - 1]