Alanxtl commented on code in PR #3665:
URL: https://github.com/apache/dubbo-go/pull/3665#discussion_r3788231988
##########
metrics/rpc/error_classifier.go:
##########
@@ -112,6 +118,12 @@ func classifyError(err error) ErrorType {
if err == nil {
return ErrorTypeUnknown
}
+ // A typed nil *triple_protocol.Error escapes err == nil, but CodeOf
+ // would panic while dereferencing it, so return ErrorTypeUnknown
instead.
+ var tripleErr *triple_protocol.Error
+ if errors.As(err, &tripleErr) && tripleErr == nil {
+ return ErrorTypeUnknown
+ }
Review Comment:
为什么要加这几行
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]