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/05/29 08:45:32 UTC

[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2396: CSE升级后,自定义的错误处理机制方法失效,类继承AbstractEdgeDispatcher

liubao68 commented on issue #2396:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2396#issuecomment-850797496


   你可以下载对应版本的源代码看下即可。 `onFailure` 是在实现类调用的, 以默认的 `DefaultEdgeDispatcher为例` 实现类需要显示的调用onFailure
   
   ```
     public void init(Router router) {
       prefix = DynamicPropertyFactory.getInstance().getStringProperty(KEY_PREFIX, "api").get();
       withVersion = DynamicPropertyFactory.getInstance().getBooleanProperty(KEY_WITH_VERSION, true).get();
       prefixSegmentCount = DynamicPropertyFactory.getInstance().getIntProperty(KEY_PREFIX_SEGMENT_COUNT, 1).get();
       String regex = generateRouteRegex(prefix, withVersion);
   
       // cookies handler are enabled by default start from 3.8.3
       router.routeWithRegex(regex).handler(createBodyHandler());
       router.routeWithRegex(regex).failureHandler(this::onFailure).handler(this::onRequest);
     }
   ```


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