Properly stringify errors
This commit is contained in:
parent
bbc2a7142e
commit
cd2922308f
|
@ -3,6 +3,7 @@ import env from "../environment"
|
||||||
import { setJSRunner, setOnErrorLog } from "@budibase/string-templates"
|
import { setJSRunner, setOnErrorLog } from "@budibase/string-templates"
|
||||||
import { context, logging, timers } from "@budibase/backend-core"
|
import { context, logging, timers } from "@budibase/backend-core"
|
||||||
import tracer from "dd-trace"
|
import tracer from "dd-trace"
|
||||||
|
import { serializeError } from "serialize-error"
|
||||||
|
|
||||||
type TrackerFn = <T>(f: () => T) => T
|
type TrackerFn = <T>(f: () => T) => T
|
||||||
|
|
||||||
|
@ -61,7 +62,7 @@ export function init() {
|
||||||
|
|
||||||
if (env.LOG_JS_ERRORS) {
|
if (env.LOG_JS_ERRORS) {
|
||||||
setOnErrorLog((error: Error) => {
|
setOnErrorLog((error: Error) => {
|
||||||
logging.logWarn(JSON.stringify(error))
|
logging.logWarn(JSON.stringify(serializeError(error)))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue