diff --git a/references/bun-catalog/trigger.config.ts b/references/bun-catalog/trigger.config.ts index a2deb7398e..c58a56447c 100644 --- a/references/bun-catalog/trigger.config.ts +++ b/references/bun-catalog/trigger.config.ts @@ -1,4 +1,5 @@ import { defineConfig } from "@trigger.dev/sdk/v3"; +import { logger } from "../../packages/core/dist/commonjs/v3/logger-api.js"; export default defineConfig({ runtime: "bun", @@ -18,7 +19,12 @@ export default defineConfig({ enableConsoleLogging: false, logLevel: "info", onStart: async (payload, { ctx }) => { - console.log(`Task ${ctx.task.id} started ${ctx.run.id}`); + try { + console.log(`Task ${ctx.task.id} started ${ctx.run.id}`); + } catch (error) { + console.log(error) + throw error; // Re-throw to fail the run + } }, onFailure: async (payload, error, { ctx }) => { console.log(`Task ${ctx.task.id} failed ${ctx.run.id}`); diff --git a/references/v3-catalog/trigger.config.ts b/references/v3-catalog/trigger.config.ts index 830ac38999..0134c1fa81 100644 --- a/references/v3-catalog/trigger.config.ts +++ b/references/v3-catalog/trigger.config.ts @@ -32,7 +32,16 @@ export default defineConfig({ enableConsoleLogging: false, logLevel: "info", onStart: async (payload, { ctx }) => { - console.log(`Task ${ctx.task.id} started ${ctx.run.id}`); + try { + console.log(`Task ${ctx.task.id} started ${ctx.run.id}`); + } catch (error) { + console.log( + `Task ${ctx.task.id} failed ${ctx.run.id}: ${ + error instanceof Error ? error.message : String(error) + }` + ); + throw error; // Re-throw to fail the run + } }, onFailure: async (payload, error, { ctx }) => { console.log(