Official docs 500 error handler returns 302 -> 200
We've followed the official docs for our Umbraco 11 site - but they use a redirect - which returns a 302 status code, not a 500.
The page which is redirected to is a normal page - so that then returns a 200.
This is a problem because all errors in controller code, and APIs will do the same thing - so our code which tries to handle errors from the API will never be hit - they look like 200 responses (with the error page HTML in the response body).
So the question is: how do I make the custom error page behave correctly and return a 500 status code?
So, how are you trying to handle the errors clientside? You coul try appending the code as a querystring variable and handling that in your error page.
Official docs 500 error handler returns 302 -> 200
We've followed the official docs for our Umbraco 11 site - but they use a redirect - which returns a 302 status code, not a 500.
The page which is redirected to is a normal page - so that then returns a 200.
This is a problem because all errors in controller code, and APIs will do the same thing - so our code which tries to handle errors from the API will never be hit - they look like 200 responses (with the error page HTML in the response body).
So the question is: how do I make the custom error page behave correctly and return a 500 status code?
Hi Ian
where and how is your code implemented for this?
I wasn't clear - I was talking about the client-side code. It uses Request. The response code isn't an error - so the error handling code isn't hit.
So, how are you trying to handle the errors clientside? You coul try appending the code as a querystring variable and handling that in your error page.
How would I add to the querystring in the error page? The client makes the request and sets the query string, right?
I meant, change the redirict in the error controller to maybe
Not really sure what you are trying to achieve, yes, clients make the request, but 500 errors come from the server not the client.
is working on a reply...