1
0
Fork 0
mirror of synced 2024-07-04 22:11:23 +12:00

Properly stringify errors

This commit is contained in:
Adria Navarro 2024-02-12 16:01:02 +01:00
parent bbc2a7142e
commit cd2922308f

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)))
})
}
}