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

[docs]: translate Custimize Error Handler #273

Merged
merged 4 commits into from
Jul 29, 2022

Conversation

rogerogers
Copy link
Contributor

@rogerogers rogerogers commented Jul 22, 2022

What type of PR is this?

docs: translate Custimize Error Handler

What this PR does / why we need it (en: English/zh: Chinese):

en: translate Custimize Error Handler
zh: 翻译错误处理

Which issue(s) this PR fixes:

cloudwego/kitex#569

@rogerogers
Copy link
Contributor Author

该函数会在服务端 handler 执行后,中间件执行前被执行,可以用于给调用端返回自定义的错误码和信息。注意,虽然对此提供了支持,但业务层面自定义的错误码依然不建议通过 ErrorHandler 处理,因为我们希望将 RPC 错误和业务的错误能够区分开,RPC 错误表示一次RPC 请求失败,比如超时、熔断、限流,从 RPC 层面是失败的请求,但业务错误属于业务逻辑层面,在 RPC 层面其实是请求成功。Kitex 会制定一个业务[自定义异常规范](https://github.com/cloudwego/kitex/issues/511)用于区分业务错误和RPC层面错误。

在 RPC 层面其实是请求成功,这里是不是应该是在RPC层面可能是请求成功。

@GuangmingLuo GuangmingLuo changed the title docs: translate Custimize Error Handler [docs]: translate Custimize Error Handler Jul 25, 2022
@CLAassistant
Copy link

CLAassistant commented Jul 27, 2022

CLA assistant check
All committers have signed the CLA.

@GuangmingLuo GuangmingLuo merged commit 5a731aa into cloudwego:main Jul 29, 2022
@rogerogers rogerogers deleted the feature-en branch July 29, 2022 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants