Skip to content

Commit af6e752

Browse files
return res.statusCode on "Server failed to respond." (#938)
* return res.statusCode on "Server failed to respond." * apply micro-optimization, pull this out into a constant above the try/catch * hardcode as a 500 * Create pretty-dodos-end.md --------- Co-authored-by: conico974 <[email protected]>
1 parent bfde44e commit af6e752

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changeset/pretty-dodos-end.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/aws": patch
3+
---
4+
5+
set the correct 500 status code on internal server error

packages/open-next/src/core/requestHandler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ async function tryRenderError(
345345
await requestHandler(requestMetadata)(_req, res);
346346
} catch (e) {
347347
error("NextJS request failed.", e);
348+
res.statusCode = 500;
348349
res.setHeader("Content-Type", "application/json");
349350
res.end(
350351
JSON.stringify(

0 commit comments

Comments
 (0)