[ 
https://issues.apache.org/jira/browse/SCB-827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16577628#comment-16577628
 ] 

ASF GitHub Bot commented on SCB-827:
------------------------------------

yhs0092 commented on a change in pull request #865: [SCB-827] Add response body 
decoding error log
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/865#discussion_r209459205
 
 

 ##########
 File path: 
transports/transport-rest/transport-rest-client/src/main/java/org/apache/servicecomb/transport/rest/client/http/DefaultHttpClientFilter.java
 ##########
 @@ -79,13 +82,15 @@ protected Object extractResult(Invocation invocation, 
HttpServletResponseEx resp
               responseEx.getStatus(),
               responseEx.getStatusType().getReasonPhrase(),
               responseEx.getHeader(HttpHeaders.CONTENT_TYPE));
+      LOGGER.error(msg);
       return ExceptionFactory.createConsumerException(new 
InvocationException(responseEx.getStatus(), 
responseEx.getStatusType().getReasonPhrase(), msg));
     }
 
     try {
       return produceProcessor.decodeResponse(responseEx.getBodyBuffer(), 
responseMeta.getJavaType());
     } catch (Exception e) {
-      return ExceptionFactory.createConsumerException(e);
+      LOGGER.error("failed to decode response body", e);
+      throw ExceptionFactory.createConsumerException(e);
 
 Review comment:
   Get it...... Maybe we can  throw the `InvocationException` directly? After 
all, a none 2xx response will be transferred into an `Exception` in 
`Invoker.syncInvoke()` and `CseClientHttpRequest.invoke()`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add response decode error log
> -----------------------------
>
>                 Key: SCB-827
>                 URL: https://issues.apache.org/jira/browse/SCB-827
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>            Reporter: YaoHaishi
>            Assignee: YaoHaishi
>            Priority: Major
>
> In DefaultHttpClientFilter.extractResult(), once response decode error 
> occurs, it will be caught and set into an InvocationException, and the 
> InvocationException will be treated as response body, which will cause 
> confusing result.
> We need to print some logs to help developers locate such problem.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to