aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor-instance.js2
-rw-r--r--query-executor.js8
2 files changed, 8 insertions, 2 deletions
diff --git a/editor-instance.js b/editor-instance.js
index 008705f..8ed6674 100644
--- a/editor-instance.js
+++ b/editor-instance.js
@@ -175,7 +175,7 @@ function _stopExecTimer() {
function handleError(err) {
_stopExecTimer();
_destroyDataTable();
- $("#result-error").removeAttr("style").text("Error (" + err.code + ") - " + err.message);
+ $("#result-error").removeAttr("style").text("Error (" + err.code + ") - " + err.cause);
_setExecutionStatusIndicator("ERROR");
$("#execution-time").text("failed after " + execElapsedTime + " ms");
}
diff --git a/query-executor.js b/query-executor.js
index 0c5b440..88df7e1 100644
--- a/query-executor.js
+++ b/query-executor.js
@@ -23,8 +23,14 @@ ipcRenderer.on("queryExecutor.runQuery", (event, payload) => {
if(payload.queryExecutorId === executorId) {
connectionPool.query(payload.query, (err, res) => {
- console.log(err, res)
+ console.log(err, res);
+ if(err !== undefined) {
+ // The IPC payload is serialised to JSON beofre transmisison, so the protoype chain is lost.
+ // So store the nicely formatted error message as a property.
+ err.cause = err.toString();
+ }
+
ipcRenderer.send("queryExecutor.runQueryComplete", {
"error": err,
"result": res,