Skip to content
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

zero #4203

Open
HanWuJiJack opened this issue Jun 21, 2024 · 4 comments
Open

zero #4203

HanWuJiJack opened this issue Jun 21, 2024 · 4 comments

Comments

@HanWuJiJack
Copy link

在流控和熔断中间件内部 我看到的如果出现错误 会改状态码为503等,我感觉返回503不细致。如果我想拦截改写返回值应该怎么做?

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Within the flow control and fuse middleware, I saw that if an error occurs, the status code will be changed to 503, etc. I feel that returning 503 is not meticulous. What should I do if I want to intercept and rewrite the return value?

@kevwan
Copy link
Contributor

kevwan commented Jun 21, 2024

You can disable the BreakerHandler and add your own.

@HanWuJiJack
Copy link
Author

我知道可以自定义,那你们提供的中间件还有什么意义呢?我认为你们可以把中间件添加到开始位置的方法暴露出来,这样应该也可以捕获到具体状态码进行改写返回值!

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I know it can be customized, but what’s the point of the middleware you provide? I think you can expose the method of adding middleware to the beginning, so that you can capture the specific status code and rewrite the return value!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants