Properly stringify errors

This commit is contained in:
Adria Navarro 2024-02-12 16:01:02 +01:00
parent bbc2a7142e
commit cd2922308f
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import env from "../environment"
import { setJSRunner, setOnErrorLog } from "@budibase/string-templates"
import { context, logging, timers } from "@budibase/backend-core"
import tracer from "dd-trace"
import { serializeError } from "serialize-error"
type TrackerFn = <T>(f: () => T) => T
@ -61,7 +62,7 @@ export function init() {
if (env.LOG_JS_ERRORS) {
setOnErrorLog((error: Error) => {
logging.logWarn(JSON.stringify(error))
logging.logWarn(JSON.stringify(serializeError(error)))
})
}
}