You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/12/22 07:03:16 UTC

[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #2154: Edge's 490 exception is thrown and can be used for business processing

liubao68 commented on a change in pull request #2154:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2154#discussion_r547103818



##########
File path: transports/transport-rest/transport-rest-client/src/main/java/org/apache/servicecomb/transport/rest/client/http/RestClientInvocation.java
##########
@@ -116,12 +118,17 @@ public void invoke(Invocation invocation, AsyncResponse asyncResp) throws Except
         filter.beforeSendRequest(invocation, requestEx);
       }
     }
+    List<HttpRestClientInvocationHook> httpRestClientInvocationHooks =
+            SPIServiceUtils.getAllService(HttpRestClientInvocationHook.class);
 
     clientRequest.exceptionHandler(e -> {
       invocation.getTraceIdLogger()
           .error(LOGGER, "Failed to send request, alreadyFailed:{}, local:{}, remote:{}, message={}.",
               alreadyFailed, getLocalAddress(), ipPort.getSocketAddress(),
               ExceptionUtils.getExceptionMessageWithoutTrace(e));
+      httpRestClientInvocationHooks.forEach(httpServerExceptionHandler -> {

Review comment:
       Maybe you can add a custom handler to fillful your requirements. 
   
   e.g. 'MyHandler implements Handler'
   
   servicecomb.handler.chain.Consumer.defaut:  your_current_handlers,myhandler
   
   myhandler can process the exception thrown in RestClientInvocation




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