Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion references/bun-catalog/trigger.config.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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}`);
Expand Down
11 changes: 10 additions & 1 deletion references/v3-catalog/trigger.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down