Skip to content

Commit 52ff942

Browse files
committed
update test code snippets
1 parent 58b769c commit 52ff942

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

platform-includes/getting-started-verify/javascript.connect.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
First, let's make sure Sentry is correctly capturing errors and creating issues in your project. Add the following code snippet to your main application file; it defines a route that will deliberately trigger an error when called:
22

33
```javascript
4-
app.get("/debug-sentry", function mainHandler(req, res) {
5-
throw new Error("My first Sentry error!");
4+
app.use("/debug-sentry", (req, res, next) => {
5+
next(new Error("My first Sentry error!"));
66
});
77
```
88

@@ -21,7 +21,7 @@ app.use("/debug-sentry", async (req, res, next) => {
2121
},
2222
async () => {
2323
await new Promise((resolve) => setTimeout(resolve, 100));
24-
throw new Error("My first Sentry error!");
24+
next(new Error("My first Sentry error!"));
2525
}
2626
);
2727
}

0 commit comments

Comments
 (0)