Skip to content

Commit fa61176

Browse files
committed
make code review changes
1 parent 750e427 commit fa61176

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/nextjs/src/utils/handlers.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const withSentry = (handler: NextApiHandler): WrappedNextApiHandler => {
9494
};
9595

9696
type ResponseEndMethod = ScopedResponse['end'];
97-
type WrappedResponseEndMethod = ScopedResponse['end'];
97+
type WrappedResponseEndMethod = ResponseEndMethod;
9898

9999
function 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

0 commit comments

Comments
 (0)