You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/07/13 15:07:12 UTC

[GitHub] [dubbo-go] pantianying commented on a change in pull request #652: Fix : the consumer cannot get the real cause error from provider

pantianying commented on a change in pull request #652:
URL: https://github.com/apache/dubbo-go/pull/652#discussion_r453717604



##########
File path: common/proxy/proxy.go
##########
@@ -154,7 +159,17 @@ func (p *Proxy) Implement(v common.RPCService) {
 			}
 
 			err = result.Error()
-			logger.Debugf("[makeDubboCallProxy] result: %v, err: %v", result.Result(), err)
+			if err != nil {
+				// the cause reason
+				err = perrors.Cause(err)
+				if throwabler, ok := err.(java_exception.Throwabler); ok {
+					logger.Errorf("invoke service throw exception: %v , stackTraceElements: %v", err.Error(), throwabler.GetStackTrace())

Review comment:
       有错误不需要打error日志,用warn或者info即可

##########
File path: common/proxy/proxy.go
##########
@@ -154,7 +159,17 @@ func (p *Proxy) Implement(v common.RPCService) {
 			}
 
 			err = result.Error()
-			logger.Debugf("[makeDubboCallProxy] result: %v, err: %v", result.Result(), err)
+			if err != nil {
+				// the cause reason
+				err = perrors.Cause(err)
+				if throwabler, ok := err.(java_exception.Throwabler); ok {
+					logger.Errorf("invoke service throw exception: %v , stackTraceElements: %v", err.Error(), throwabler.GetStackTrace())
+				} else {
+					logger.Errorf("result err: %v", err)
+				}
+			} else {

Review comment:
       建议else能去则去掉下




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org