diff --git a/packages/server/package.json b/packages/server/package.json index 9d385c7664..e600e36bd3 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -103,6 +103,7 @@ "pouchdb-all-dbs": "1.1.1", "pouchdb-find": "7.2.2", "redis": "4", + "serialize-error": "^7.0.1", "server-destroy": "1.0.1", "snowflake-promise": "^4.5.0", "socket.io": "4.6.1", diff --git a/packages/server/src/jsRunner/index.ts b/packages/server/src/jsRunner/index.ts index 38cd0dd0d6..e39dab1313 100644 --- a/packages/server/src/jsRunner/index.ts +++ b/packages/server/src/jsRunner/index.ts @@ -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 = (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))) }) } }