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 2021/02/04 07:37:00 UTC

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

Volcannozzz commented on pull request #2154:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2154#issuecomment-773099927


   I think the handler example given by @liubao68  cannot meet @liuguangrong 's needs. Because the transportHandler is the last handler in the source code.
   
   ```java
   public class ConsumerHandlerManager extends AbstractHandlerManager {
     @Override
     protected String getName() {
       return "Consumer";
     }
   
     @Override
     protected String getInnerDefaultChainDef() {
       return "simpleLB";
     }
   
     @Override
     protected Handler getLastHandler() {
       return TransportClientHandler.INSTANCE;
     }
   }
   ```
   and in `AbstractHandlerManager.java`
   
   ```java
     private List<Handler> createHandlerChain(String chainDef) {
       List<Class<Handler>> chainClasses = convertToChainClass(chainDef);
   
       List<Handler> handlerList = new ArrayList<>();
       for (Class<Handler> cls : chainClasses) {
         try {
           handlerList.add(cls.newInstance());
         } catch (Exception e) {
           // 在启动阶段直接抛异常出来
           throw new Error(e);
         }
       }
       handlerList.add(getLastHandler());
       return handlerList;
     }
   ```
   In addition, when the transportHandler calls an exception, it will return the exception information to the caller. Can the exception information be handled by the caller? Hope you provide the calling way and error message stack.


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