Skip to content

Commit cb93119

Browse files
committed
fix v3-catalog
1 parent 9d6f959 commit cb93119

File tree

4 files changed

+20
-23
lines changed

4 files changed

+20
-23
lines changed

references/v3-catalog/src/handleError.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { tasks } from "@trigger.dev/sdk";
2+
3+
tasks.onStart(({ payload, ctx }) => {
4+
console.log(`Task ${ctx.task.id} started ${ctx.run.id}`);
5+
});
6+
7+
tasks.onFailure(({ payload, error, ctx }) => {
8+
console.log(
9+
`Task ${ctx.task.id} failed ${ctx.run.id}: ${
10+
error instanceof Error ? error.message : String(error)
11+
}`
12+
);
13+
});
14+
15+
tasks.catchError(({ payload, ctx, task, error, retry, retryAt, retryDelayInMs }) => {
16+
console.log("handling error", { error, retry, retryAt, retryDelayInMs });
17+
});

references/v3-catalog/src/trigger/playwrightTask.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { logger, task } from "@trigger.dev/sdk/v3";
22
import { chromium } from "playwright";
3-
43
/**
54
* Example task demonstrating Playwright browser automation with Trigger.dev
65
*
@@ -23,7 +22,9 @@ export const playwrightTestTask = task({
2322
maxAttempts: 1,
2423
},
2524
run: async () => {
26-
logger.log("Starting Playwright automation task");
25+
const playwrightVersion = require("playwright/package.json").version;
26+
27+
logger.log("Starting Playwright automation task", { version: playwrightVersion });
2728

2829
for (const browserType of [chromium]) {
2930
const prefix = (msg: string) => `[${browserType.name()}]: ${msg}`;

references/v3-catalog/trigger.config.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import { prismaExtension } from "@trigger.dev/build/extensions/prisma";
1010
import { emitDecoratorMetadata } from "@trigger.dev/build/extensions/typescript";
1111
import { defineConfig } from "@trigger.dev/sdk/v3";
1212

13-
export { handleError } from "./src/handleError.js";
14-
1513
export default defineConfig({
1614
runtime: "node",
1715
project: "yubjwjsfkxnylobaqvqz",
@@ -32,16 +30,6 @@ export default defineConfig({
3230
},
3331
enableConsoleLogging: false,
3432
logLevel: "info",
35-
onStart: async (payload, { ctx }) => {
36-
console.log(`Task ${ctx.task.id} started ${ctx.run.id}`);
37-
},
38-
onFailure: async (payload, error, { ctx }) => {
39-
console.log(
40-
`Task ${ctx.task.id} failed ${ctx.run.id}: ${
41-
error instanceof Error ? error.message : String(error)
42-
}`
43-
);
44-
},
4533
build: {
4634
conditions: ["react-server"],
4735
extensions: [

0 commit comments

Comments
 (0)