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 06:44:22 UTC

[GitHub] [dubbo-go] cvictory opened a new pull request #652: Fix : the consumer cannot get the real cause error from provider

cvictory opened a new pull request #652:
URL: https://github.com/apache/dubbo-go/pull/652


   1.现在中间件的返回值
   代码中的样子:
   ```
   // 来自于proxy
   return &protocol.RPCResult{		return &protocol.RPCResult{
   		Err: perrors.Errorf("Failed to invoke the method %v in the service %v. Tried %v times of the providers %v (%v/%v)from the registry %v on the consumer %v using the dubbo version %v. Last error is %v.",			Err: perrors.Wrap(result.Error(), fmt.Sprintf("Failed to invoke the method %v in the service %v. "+
   			methodName, invokerSvc, retries, providers, len(providers), len(invokers), invokerUrl, ip, constant.Version, result.Error().Error(),				"Tried %v times of the providers %v (%v/%v)from the registry %v on the consumer %v using the dubbo version %v. "+
   			"Last error is %+v.", methodName, invokerSvc, retries, providers, len(providers), len(invokers),
   			invokerUrl, ip, constant.Version, result.Error().Error()),
   		)}
   ```
   
   应用中的返回值:
   ![image](https://user-images.githubusercontent.com/4089452/87278241-8f28f580-c516-11ea-8279-3d70ff318719.png)
   
   说明原始的error丢失了,所以这个需要能够包装,应用中可以获取的cause。 这样,server端抛出来的异常才能被解析到。
   
   2. 日志修改
   


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


[GitHub] [dubbo-go] AlexStocks merged pull request #652: Fix : the consumer cannot get the real cause error from provider

Posted by GitBox <gi...@apache.org>.
AlexStocks merged pull request #652:
URL: https://github.com/apache/dubbo-go/pull/652


   


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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
zouyx commented on pull request #652:
URL: https://github.com/apache/dubbo-go/pull/652#issuecomment-657982617


   Travis failing


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


[GitHub] [dubbo-go] zouyx edited a comment on pull request #652: Fix : the consumer cannot get the real cause error from provider

Posted by GitBox <gi...@apache.org>.
zouyx edited a comment on pull request #652:
URL: https://github.com/apache/dubbo-go/pull/652#issuecomment-657982617


   Travis still failing


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