From b34ca5b4a2d7365c8aea7ecc56439a89ba665f5f Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 12 Nov 2021 11:21:06 +0000 Subject: [PATCH] Quick fix for #3343 - error message did not make the problem obvious, so made sure error handler always outputs something useful. --- packages/server/src/automations/automationUtils.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/server/src/automations/automationUtils.js b/packages/server/src/automations/automationUtils.js index 2cf4b35a18..aab341a1f8 100644 --- a/packages/server/src/automations/automationUtils.js +++ b/packages/server/src/automations/automationUtils.js @@ -64,5 +64,14 @@ exports.cleanUpRow = async (appId, tableId, row) => { } exports.getError = err => { + if (err == null) { + return "No error provided." + } + if ( + typeof err === "object" && + (err.toString == null || err.toString() === "[object Object]") + ) { + return JSON.stringify(err) + } return typeof err !== "string" ? err.toString() : err }