You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
setResponseStatus does not work anymore with throw new Error(...) #5107
Go to https://codesandbox.io/p/devbox/bold-johnson-3ly6mc?workspaceId=ws_VUPqXCcptK4abDwy6H7mEq
Click on the button
Check network tab
Check that we got 500 instead of 401
Expected behavior
As a user (not logged), I should get a 401 status instead of 500.
changed the title [-]`setResponseStatus` does not work anymore with `throw new Error('')`[/-][+]`setResponseStatus` does not work anymore with `throw new Error(...)`[/+]on Sep 8, 2025
This is fixed on current main. I reproduced the original behaviour on v1.131.36, where setting the response status to 401 and then throwing from function middleware returned 500. The same production server-function request now returns 401 in Chromium.
The relevant response handling change landed through #5189 and was available from v1.132.0.
If this still happens on a current version, please open a new issue with an updated reproduction.
Activity
[-]`setResponseStatus` does not work anymore with `throw new Error('')`[/-][+]`setResponseStatus` does not work anymore with `throw new Error(...)`[/+]schiller-manuel commentedon Sep 28, 2025
does this issue still exist on the latest version?
response reconciliation
LadyBluenotes commentedon Jul 15, 2026
This is fixed on current main. I reproduced the original behaviour on
v1.131.36, where setting the response status to401and then throwing from function middleware returned500. The same production server-function request now returns401in Chromium.The relevant response handling change landed through #5189 and was available from
v1.132.0.If this still happens on a current version, please open a new issue with an updated reproduction.