-
Notifications
You must be signed in to change notification settings - Fork 818
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
server client WithErrorHandler invalid #1224
Comments
有请求才会执行MetaHandler |
就是请求了,返回的是一个error,但WithErrorHandler不执行了,把MetaHandler去掉了,就好了 |
server.ErrorHandler 是使用 kitex 中间件的方式来实现的,会接收 |
谢谢 @cqqqq777 的回复,@xu756 ErrorHandler 只有rpc error(认定为此次rpc请求失败的异常,不包括 biz error)才会执行,biz error是业务层面定义的状态信息,不算rpc失败。你应该如 @cqqqq777 所说使用了业务异常,所以ErrorHandler没有输出。
|
我想把 biz error 替换掉,是可行的吧 |
如果要处理biz error的话,用可以用中间件来实现,检查 |
我看了官方教程,使用了WithMetaHandler 才能自定义错误,
但明明有错误,client 和 server的WithMetaHandler,调用不了,而且日志也不打印
The text was updated successfully, but these errors were encountered: