Skip to content

Commit 7b1c5a2

Browse files
committed
stop awaiting result of domain-bound handler
1 parent d5b4b4e commit 7b1c5a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/nextjs/src/utils/withSentry.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ export const withSentry = (origHandler: NextApiHandler): WrappedNextApiHandler =
107107
}
108108
});
109109

110-
return await boundHandler();
110+
// Since API route handlers are all async, nextjs always awaits the return value (meaning it's fine for us to return
111+
// a promise here rather than a real result, and it saves us the overhead of an `await` call.)
112+
return boundHandler();
111113
};
112114
};
113115

0 commit comments

Comments
 (0)