Skip to content

Commit 862be23

Browse files
committed
chore: remove try catch
1 parent eac31d1 commit 862be23

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

pages/api/test4.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ import * as Sentry from '@sentry/nextjs'
22

33
async function handler(req, res) {
44
try {
5-
try {
6-
throw new Error('API Test 4')
7-
} catch (error) {
8-
Sentry.captureException(error)
9-
}
10-
11-
// Flushing before returning is necessary if deploying to Vercel, see
12-
// https://vercel.com/docs/platform/limits#streaming-responses
13-
await Sentry.flush(2000)
14-
} catch (err) {
15-
console.log(err)
5+
throw new Error('API Test 4')
6+
} catch (error) {
7+
Sentry.captureException(error)
168
}
9+
10+
// Flushing before returning is necessary if deploying to Vercel, see
11+
// https://vercel.com/docs/platform/limits#streaming-responses
12+
await Sentry.flush(2000)
1713
res.status(200).json({ name: 'John Doe' })
1814
}
1915

0 commit comments

Comments
 (0)