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
Change http response code based on backend error #16115
Conversation
@@ -26,6 +26,7 @@ const ( | |||
natsBackend = "nats" | |||
jestreamHandlerName = "jetstream-handler" | |||
noSpaceLeftErrMessage = "no space left on device" | |||
natsMaxBytesExceeded = "nats: maximum bytes exceeded" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use the ErrMaxBytes
from nats-server library and use then errors.Is
instead of checking for error text ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we cannot, but i improved the code to evaluate the errorcode returned by the api
✅ 🥰 Documentation preview ready! 🥰
To edit notification comments on pull requests, go to your Netlify site settings. |
@k15r: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
* introduce common errors to allow returning custom http responses * bump image * evaluate API Error returned by nats * fix code review comments
* Change http response code based on backend error (#16115) * introduce common errors to allow returning custom http responses * bump image * evaluate API Error returned by nats * fix code review comments * update stream configuration according to env vars (#16111) * update stream configuration according to env vars * fix tests * disable strict shadowing linting, to allow shadowing of `err` * parse units in maxbytes environment * fix more tests * set discardPolicy * fix review comments * bump images
Description
Changes proposed in this pull request:
Related issue(s)