Skip to content

Commit 4702da7

Browse files
committed
stop awaiting result of domain-bound handler
1 parent 517f73e commit 4702da7

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
@@ -157,7 +157,9 @@ export const withSentry = (origHandler: NextApiHandler): WrappedNextApiHandler =
157157
}
158158
});
159159

160-
return await boundHandler();
160+
// Since API route handlers are all async, nextjs always awaits the return value (meaning it's fine for us to return
161+
// a promise here rather than a real result, and it saves us the overhead of an `await` call.)
162+
return boundHandler();
161163
};
162164
};
163165

0 commit comments

Comments
 (0)