-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error handling #7093
Comments
I agree. That has been on our TODO, but we haven't had it prioritized. Currently it depends a bit on which phase the code runs that what happens with errors. E.g. plugin that throws runtime exception or other error on header_filter phase will just end and close the connection without response. I think we should always catch these errors, and it seems in access phase we do. Thank you for starting this work. |
Thank you @bungle, Do you think it can be done incrementally, the fix I propose here is to make the error that currently exists in kong consistent and customisable. I agree that handling other kinds of errors should be done as well, but it is a broader scope IMO. |
Is there any news on this one ? This is a real issue in our side because we need to present a customized error page in case of kong error, maybe there is some workaround to do this ? |
Still no news ? |
We would need this feature to have a consistent error response across the entire exposed API, in particular we want to return a Problem Details object https://datatracker.ietf.org/doc/html/rfc7807 on every HTTP errors, and also hide internal Kong errors if possible. |
Reopening so this will be closed by #10374 |
Improve and allow a more consistent error handling
Hi,
The error handling in kong is somewhat inconsistent:
kong.response.error
call, it will respond with a body build depending on mime typeWhen kong is a installed as a gateway that serve html along with json API's, these json errors are perceived like a bug...
Furthermore, when the errors are built depending on the mime type of the request, it use some hardcoded templates. I think it will be good if the kong user can override these templates to allow customisation.
That cause us some difficulties as well, when kong serve website that return HTML and do not allow to serve a branded error page.
I tried to fix this in this PR (still draft) by systematically calling to
kong.response.error
function in kong code to allow consistent errors response and also added a error template file configuration to allow error template override.I would like to receive some feedback on this
Thanks !
The text was updated successfully, but these errors were encountered: