-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Labels
type:feature_requestIssue with a feature requestIssue with a feature request
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the problem to be solved
I have this setup as a default error handler on my k8s cluster, and it works great overall. My apis deployed on the cluster have a bit of an issue though.
When returning a 404 or something that this project is setup to respond for, my error content is ignored.
This turns my
{
"error": "location_invalid",
"message": "Given location either does not exist or is invalid."
}
Into
{
"error": true,
"code": "404",
"message": "Not Found",
"description": "The server can not find the requested page",
}
Suggest a solution
I propose modifying the error page to pull from the response body if it is provided
Something like
| props.Message = page.Message() |
props.Message = string(ctx.Request.Body.Peek(Message))
I dont know go, so not sure if thats how it would be implemented.
This could be configured behind a bool for ALLOW_ERROR_MESSAGE_PASSTHROUGH which would default to false to maintain consistency with prior behavior.
Additional context
No response
Metadata
Metadata
Assignees
Labels
type:feature_requestIssue with a feature requestIssue with a feature request