File tree 1 file changed +2
-3
lines changed
packages/nextjs/src/utils
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ export const withSentry = (handler: NextApiHandler): WrappedNextApiHandler => {
94
94
} ;
95
95
96
96
type ResponseEndMethod = ScopedResponse [ 'end' ] ;
97
- type WrappedResponseEndMethod = ScopedResponse [ 'end' ] ;
97
+ type WrappedResponseEndMethod = ResponseEndMethod ;
98
98
99
99
function wrapEndMethod ( origEnd : ResponseEndMethod ) : WrappedResponseEndMethod {
100
100
return async function newEnd ( this : ScopedResponse , ...args : unknown [ ] ) {
@@ -125,10 +125,9 @@ function wrapEndMethod(origEnd: ResponseEndMethod): WrappedResponseEndMethod {
125
125
try {
126
126
logger . log ( 'Flushing events...' ) ;
127
127
await flush ( 2000 ) ;
128
+ logger . log ( 'Done flushing events' ) ;
128
129
} catch ( e ) {
129
130
logger . log ( `Error while flushing events:\n${ e } ` ) ;
130
- } finally {
131
- logger . log ( 'Done flushing events' ) ;
132
131
}
133
132
134
133
// now that our work is done, we can pop off the scope and allow the response to end
You can’t perform that action at this time.
0 commit comments