Skip to content

Commit 303e2bd

Browse files
committed
update verify code snippets
1 parent 485d7c5 commit 303e2bd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
### Issues
2+
13
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:
24

35
```javascript
4-
app.use("/debug-sentry", (req, res, next) => {
5-
next(new Error("My first Sentry error!"));
6+
app.use("/debug-sentry", (req, res) => {
7+
throw new Error("My first Sentry error!");
68
});
79
```
810

@@ -13,15 +15,15 @@ app.use("/debug-sentry", (req, res, next) => {
1315
To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes for the execution of your code:
1416

1517
```javascript
16-
app.use("/debug-sentry", async (req, res, next) => {
18+
app.use("/debug-sentry", async (req, res) => {
1719
await Sentry.startSpan(
1820
{
1921
op: "test",
2022
name: "My First Test Transaction",
2123
},
2224
async () => {
2325
await new Promise((resolve) => setTimeout(resolve, 100));
24-
next(new Error("My first Sentry error!"));
26+
throw new Error("My first Sentry error!");
2527
}
2628
);
2729
}

0 commit comments

Comments
 (0)