Quick fix for #3343 - error message did not make the problem obvious, so made sure error handler always outputs something useful.

This commit is contained in:
mike12345567 2021-11-12 11:21:06 +00:00
parent d1714b7f9a
commit 7a23df361d
1 changed files with 9 additions and 0 deletions

View File

@ -64,5 +64,14 @@ exports.cleanUpRow = async (appId, tableId, row) => {
} }
exports.getError = err => { 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 return typeof err !== "string" ? err.toString() : err
} }