Browse Source
Merge pull request #3348 from Budibase/fix/auto-error
Handling complex errors in automation test error handler
pull/3440/head
Michael Drury
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
0 deletions
-
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 |
|
|
|
} |
|
|
|
|