File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
packages/nextjs/src/utils Expand file tree Collapse file tree 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 => {
9494} ;
9595
9696type ResponseEndMethod = ScopedResponse [ 'end' ] ;
97- type WrappedResponseEndMethod = ScopedResponse [ 'end' ] ;
97+ type WrappedResponseEndMethod = ResponseEndMethod ;
9898
9999function wrapEndMethod ( origEnd : ResponseEndMethod ) : WrappedResponseEndMethod {
100100 return async function newEnd ( this : ScopedResponse , ...args : unknown [ ] ) {
@@ -125,10 +125,9 @@ function wrapEndMethod(origEnd: ResponseEndMethod): WrappedResponseEndMethod {
125125 try {
126126 logger . log ( 'Flushing events...' ) ;
127127 await flush ( 2000 ) ;
128+ logger . log ( 'Done flushing events' ) ;
128129 } catch ( e ) {
129130 logger . log ( `Error while flushing events:\n${ e } ` ) ;
130- } finally {
131- logger . log ( 'Done flushing events' ) ;
132131 }
133132
134133 // 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