Merge pull request #3348 from Budibase/fix/auto-error
Handling complex errors in automation test error handler
This commit is contained in:
commit
71ec5a0e44
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue