File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,18 @@ import * as Sentry from '@sentry/nextjs'
2
2
3
3
async function handler ( req , res ) {
4
4
try {
5
- throw new Error ( 'API Test 4' )
6
- } catch ( error ) {
7
- Sentry . captureException ( error )
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 )
8
16
}
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 )
13
17
res . status ( 200 ) . json ( { name : 'John Doe' } )
14
18
}
15
19
You can’t perform that action at this time.
0 commit comments