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

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

liubao68 closed pull request #904: [SCB-905] Add global rest failure handler
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/904
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/SPIOrder.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/SPIOrder.java
new file mode 100644
index 000000000..b9fc016ee
--- /dev/null
+++ 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/SPIOrder.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.foundation.common.utils;
+
+public interface SPIOrder {
+  default int getOrder() {
+    return 0;
+  }
+}
diff --git 
a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/ConsumerMain.java
 
b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/ConsumerMain.java
index a3b770471..4a8e08d32 100644
--- 
a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/ConsumerMain.java
+++ 
b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/ConsumerMain.java
@@ -25,10 +25,11 @@
 import org.apache.servicecomb.it.testcase.TestDefaultValue;
 import org.apache.servicecomb.it.testcase.TestIgnoreMethod;
 import org.apache.servicecomb.it.testcase.TestParamCodec;
+import org.apache.servicecomb.it.testcase.TestParamCodecEdge;
+import org.apache.servicecomb.it.testcase.TestRestServerConfig;
+import org.apache.servicecomb.it.testcase.TestRestServerConfigEdge;
 import org.apache.servicecomb.it.testcase.TestTrace;
 import org.apache.servicecomb.it.testcase.TestTraceEdge;
-import org.apache.servicecomb.it.testcase.base.TestParamCodecEdge;
-import org.apache.servicecomb.it.testcase.base.TestRestServerConfig;
 
 public class ConsumerMain {
   private static ResultPrinter resultPrinter = new ResultPrinter();
@@ -115,6 +116,7 @@ private static void testStandalone() throws Throwable {
     ITJUnitUtils.run(TestParamCodecEdge.class);
 
     ITJUnitUtils.runWithRest(TestRestServerConfig.class);
+    ITJUnitUtils.run(TestRestServerConfigEdge.class);
 
     ITJUnitUtils.getParents().pop();
     deploys.getBaseProducer().stop();
diff --git 
a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/extend/engine/GateRestTemplate.java
 
b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/extend/engine/GateRestTemplate.java
index 7c79a2d4b..a66c2f411 100644
--- 
a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/extend/engine/GateRestTemplate.java
+++ 
b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/extend/engine/GateRestTemplate.java
@@ -30,6 +30,9 @@
 import org.springframework.web.client.RestTemplate;
 
 public class GateRestTemplate extends RestTemplate {
+
+  private String urlPrefix;
+
   public static RestTemplate createEdgeRestTemplate(String schemaId) {
     return createEdgeRestTemplate("it-producer", schemaId);
   }
@@ -51,6 +54,21 @@ public GateRestTemplate(String gateName, String schemaId) {
   }
 
   public GateRestTemplate(String gateName, String producerName, String 
schemaId) {
+    urlPrefix = getUrlPrefix(gateName, producerName, schemaId);
+
+    setUriTemplateHandler(new ITUriTemplateHandler(urlPrefix));
+
+    setMessageConverters(Arrays.asList(
+        new MappingJackson2HttpMessageConverter(),
+        new StringHttpMessageConverter()
+    ));
+  }
+
+  public String getUrlPrefix() {
+    return urlPrefix;
+  }
+
+  private String getUrlPrefix(String gateName, String producerName, String 
schemaId) {
     MicroserviceVersionRule microserviceVersionRule = 
RegistryUtils.getServiceRegistry().getAppManager()
         .getOrCreateMicroserviceVersionRule(RegistryUtils.getAppId(), gateName,
             DefinitionConst.VERSION_RULE_ALL);
@@ -68,15 +86,8 @@ public GateRestTemplate(String gateName, String 
producerName, String schemaId) {
             DefinitionConst.VERSION_RULE_ALL);
     MicroserviceVersionMeta microserviceVersionMeta = 
microserviceVersionRule.getLatestMicroserviceVersion();
     SchemaMeta schemaMeta = 
microserviceVersionMeta.getMicroserviceMeta().ensureFindSchemaMeta(schemaId);
-    String urlPrefix = String
+    return String
         .format("%s://%s:%d/rest/%s%s", urlSchema, edgeAddress.getHostOrIp(), 
edgeAddress.getPort(), producerName,
             schemaMeta.getSwagger().getBasePath());
-
-    setUriTemplateHandler(new ITUriTemplateHandler(urlPrefix));
-
-    setMessageConverters(Arrays.asList(
-        new MappingJackson2HttpMessageConverter(),
-        new StringHttpMessageConverter()
-    ));
   }
 }
diff --git 
a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestParamCodecEdge.java
 
b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestParamCodecEdge.java
similarity index 96%
rename from 
integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestParamCodecEdge.java
rename to 
integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestParamCodecEdge.java
index 2ca171af3..9a5f6ac07 100644
--- 
a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestParamCodecEdge.java
+++ 
b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestParamCodecEdge.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.it.testcase.base;
+package org.apache.servicecomb.it.testcase;
 
 import static org.junit.Assert.assertEquals;
 
diff --git 
a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestRestServerConfig.java
 
b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRestServerConfig.java
similarity index 95%
rename from 
integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestRestServerConfig.java
rename to 
integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRestServerConfig.java
index 6192c7ee0..2f7ccc00e 100644
--- 
a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestRestServerConfig.java
+++ 
b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRestServerConfig.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.it.testcase.base;
+package org.apache.servicecomb.it.testcase;
 
 import org.apache.servicecomb.it.Consumers;
 import org.apache.servicecomb.it.junit.ITJUnitUtils;
@@ -58,7 +58,7 @@ public void testMaxInitialLineLength5000() {
   public void testMaxInitialLineLength5001() {
     String q = Strings.repeat("q", 5001 - INITIAL_LINE_PREFIX.length() - 
INITIAL_LINE_SUFFIX.length());
     try {
-      consumers.getIntf().testMaxInitialLineLength(q.toString());
+      consumers.getIntf().testMaxInitialLineLength(q);
       Assert.fail("an exception is expected!");
     } catch (InvocationException e) {
       Assert.assertEquals(414, e.getStatusCode());
diff --git 
a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRestServerConfigEdge.java
 
b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRestServerConfigEdge.java
new file mode 100644
index 000000000..29800040e
--- /dev/null
+++ 
b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRestServerConfigEdge.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.it.testcase;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.Scanner;
+
+import org.apache.servicecomb.it.extend.engine.GateRestTemplate;
+import org.junit.Test;
+
+public class TestRestServerConfigEdge {
+  static GateRestTemplate rt = (GateRestTemplate) 
GateRestTemplate.createEdgeRestTemplate("dataTypeJaxrs");
+
+  @Test
+  public void testIllegalPathParam() throws IOException {
+    String paramString = "%%A";
+    String requestUri =
+        rt.getUrlPrefix() + "/intPath/" + paramString;
+
+    URL url = new URL(requestUri);
+    HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
+
+    String errorBody = null;
+    int responseCode = urlConnection.getResponseCode();
+    String responseMessage = urlConnection.getResponseMessage();
+    try (Scanner scanner = new Scanner(urlConnection.getErrorStream())) {
+      errorBody = scanner.nextLine();
+    } catch (Throwable throwable) {
+      throwable.printStackTrace();
+    }
+    urlConnection.disconnect();
+
+    assertEquals(500, responseCode);
+    assertEquals("Internal Server Error", responseMessage);
+    assertEquals("{\"message\":\"unknown error\"}", errorBody);
+  }
+}
diff --git 
a/integration-tests/it-producer/src/main/java/org/apache/servicecomb/it/schema/DownloadSchema.java
 
b/integration-tests/it-producer/src/main/java/org/apache/servicecomb/it/schema/DownloadSchema.java
index 6ea04420c..d98a7ab3d 100644
--- 
a/integration-tests/it-producer/src/main/java/org/apache/servicecomb/it/schema/DownloadSchema.java
+++ 
b/integration-tests/it-producer/src/main/java/org/apache/servicecomb/it/schema/DownloadSchema.java
@@ -133,7 +133,7 @@ public Part chineseAndSpaceFile(String content) throws 
IOException {
   @ApiResponses({
       @ApiResponse(code = 200, response = File.class, message = ""),
   })
-  public Resource resource(String content) throws IOException {
+  public Resource resource(String content) {
     return new ByteArrayResource(content.getBytes(StandardCharsets.UTF_8)) {
       @Override
       public String getFilename() {
@@ -146,7 +146,7 @@ public String getFilename() {
   @ApiResponses({
       @ApiResponse(code = 200, response = File.class, message = ""),
   })
-  public ResponseEntity<Resource> entityResource(String content) throws 
IOException {
+  public ResponseEntity<Resource> entityResource(String content) {
     return ResponseEntity
         .ok()
         .header(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN_VALUE)
@@ -158,7 +158,7 @@ public String getFilename() {
   @ApiResponses({
       @ApiResponse(code = 200, response = File.class, message = ""),
   })
-  public ResponseEntity<InputStream> entityInputStream(String content) throws 
IOException {
+  public ResponseEntity<InputStream> entityInputStream(String content) {
     return ResponseEntity
         .ok()
         .header(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN_VALUE)
@@ -170,7 +170,7 @@ public String getFilename() {
   @ApiResponses({
       @ApiResponse(code = 200, response = File.class, message = ""),
   })
-  public ResponseEntity<byte[]> bytes(String content) throws IOException {
+  public ResponseEntity<byte[]> bytes(String content) {
     return ResponseEntity
         .ok()
         .header(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN_VALUE)
@@ -186,10 +186,12 @@ public String getFilename() {
     URL url = new URL("http://localhost:9000/download/netInputStream?content=";
         + URLEncoder.encode(content, StandardCharsets.UTF_8.name()));
     HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-    return ResponseEntity
+    ResponseEntity<InputStream> responseEntity = ResponseEntity
         .ok()
         .header(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN_VALUE)
         .header(HttpHeaders.CONTENT_DISPOSITION, 
"attachment;filename=netInputStream.txt")
         .body(conn.getInputStream());
+    conn.disconnect();
+    return responseEntity;
   }
 }
diff --git 
a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/GlobalRestFailureHandler.java
 
b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/GlobalRestFailureHandler.java
new file mode 100644
index 000000000..8bf935187
--- /dev/null
+++ 
b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/GlobalRestFailureHandler.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.transport.rest.vertx;
+
+import org.apache.servicecomb.foundation.common.utils.SPIOrder;
+
+import io.vertx.core.Handler;
+import io.vertx.ext.web.RoutingContext;
+
+public interface GlobalRestFailureHandler extends Handler<RoutingContext>, 
SPIOrder {
+}
diff --git 
a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/RestServerVerticle.java
 
b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/RestServerVerticle.java
index 757f44d75..c3944e64d 100644
--- 
a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/RestServerVerticle.java
+++ 
b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/RestServerVerticle.java
@@ -21,6 +21,9 @@
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import javax.ws.rs.core.MediaType;
+
+import org.apache.servicecomb.common.rest.codec.RestObjectMapperFactory;
 import org.apache.servicecomb.core.Const;
 import org.apache.servicecomb.core.CseContext;
 import org.apache.servicecomb.core.Endpoint;
@@ -35,21 +38,25 @@
 import org.apache.servicecomb.foundation.vertx.ConnectionEvent;
 import org.apache.servicecomb.foundation.vertx.TransportType;
 import org.apache.servicecomb.foundation.vertx.VertxTLSBuilder;
+import org.apache.servicecomb.swagger.invocation.exception.CommonExceptionData;
 import 
org.apache.servicecomb.transport.rest.vertx.accesslog.AccessLogConfiguration;
 import 
org.apache.servicecomb.transport.rest.vertx.accesslog.impl.AccessLogHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpHeaders;
 
 import com.netflix.config.DynamicPropertyFactory;
 
 import io.vertx.core.AbstractVerticle;
 import io.vertx.core.Context;
 import io.vertx.core.Future;
+import io.vertx.core.Handler;
 import io.vertx.core.Vertx;
 import io.vertx.core.http.HttpMethod;
 import io.vertx.core.http.HttpServer;
 import io.vertx.core.http.HttpServerOptions;
 import io.vertx.ext.web.Router;
+import io.vertx.ext.web.RoutingContext;
 import io.vertx.ext.web.handler.CorsHandler;
 
 public class RestServerVerticle extends AbstractVerticle {
@@ -89,6 +96,7 @@ public void start(Future<Void> startFuture) throws Exception {
         return;
       }
       Router mainRouter = Router.router(vertx);
+      mountGlobalRestFailureHandler(mainRouter);
       mountAccessLogHandler(mainRouter);
       mountCorsHandler(mainRouter);
       initDispatcher(mainRouter);
@@ -117,6 +125,28 @@ public void start(Future<Void> startFuture) throws 
Exception {
     }
   }
 
+  private void mountGlobalRestFailureHandler(Router mainRouter) {
+    GlobalRestFailureHandler globalRestFailureHandler =
+        
SPIServiceUtils.getPriorityHighestService(GlobalRestFailureHandler.class);
+    Handler<RoutingContext> failureHandler = null == globalRestFailureHandler ?
+        ctx -> {
+          LOGGER.error("unexpected failure happened", ctx.failure());
+          CommonExceptionData unknownError = new CommonExceptionData("unknown 
error");
+          try {
+            
ctx.response().setStatusCode(500).putHeader(HttpHeaders.CONTENT_TYPE, 
MediaType.APPLICATION_JSON)
+                
.end(RestObjectMapperFactory.getRestObjectMapper().writeValueAsString(unknownError));
+          } catch (Exception e) {
+            LOGGER.error("failed to send error response!");
+          }
+        }
+        : globalRestFailureHandler;
+
+    mainRouter.route()
+        // this handler does nothing, just ensure the failure handler can 
catch exception
+        .handler(RoutingContext::next)
+        .failureHandler(failureHandler);
+  }
+
   private void mountAccessLogHandler(Router mainRouter) {
     if (AccessLogConfiguration.INSTANCE.getAccessLogEnabled()) {
       String pattern = AccessLogConfiguration.INSTANCE.getAccesslogPattern();
diff --git 
a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestRestServerVerticle.java
 
b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestRestServerVerticle.java
index fb7a13cfe..0ef37e350 100644
--- 
a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestRestServerVerticle.java
+++ 
b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestRestServerVerticle.java
@@ -21,6 +21,8 @@
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import javax.xml.ws.Holder;
+
 import org.apache.servicecomb.core.CseContext;
 import org.apache.servicecomb.core.Endpoint;
 import org.apache.servicecomb.core.Transport;
@@ -37,11 +39,14 @@
 
 import io.vertx.core.Context;
 import io.vertx.core.Future;
+import io.vertx.core.Handler;
 import io.vertx.core.Vertx;
 import io.vertx.core.http.HttpMethod;
+import io.vertx.core.http.HttpServerResponse;
 import io.vertx.core.json.JsonObject;
 import io.vertx.ext.web.Route;
 import io.vertx.ext.web.Router;
+import io.vertx.ext.web.RoutingContext;
 import io.vertx.ext.web.handler.CorsHandler;
 import mockit.Deencapsulation;
 import mockit.Expectations;
@@ -245,4 +250,40 @@ CorsHandler getCorsHandler(String corsAllowedOrigin) {
     Deencapsulation.invoke(server, "mountCorsHandler", router);
     Assert.assertEquals(7, counter.get());
   }
+
+  @Test
+  public void mountGlobalRestFailureHandler() {
+    Router mainRouter = Mockito.mock(Router.class);
+    Holder<Handler<RoutingContext>> handlerHolder = new Holder<>();
+    Holder<Route> routeHolder = new Holder<>();
+    Route route = new MockUp<Route>() {
+      @Mock
+      Route failureHandler(Handler<RoutingContext> failureHandler) {
+        handlerHolder.value = failureHandler;
+        return null;
+      }
+
+      @Mock
+      Route handler(io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> 
requestHandler) {
+        return routeHolder.value;
+      }
+    }.getMockInstance();
+    routeHolder.value = route;
+
+    Mockito.when(mainRouter.route()).thenReturn(route);
+
+    RestServerVerticle restServerVerticle = new RestServerVerticle(new 
AtomicInteger());
+
+    Deencapsulation.invoke(restServerVerticle, 
"mountGlobalRestFailureHandler", mainRouter);
+    Assert.assertNotNull(handlerHolder.value);
+
+    RoutingContext routingContext = Mockito.mock(RoutingContext.class);
+    HttpServerResponse response = Mockito.mock(HttpServerResponse.class);
+    Mockito.when(response.setStatusCode(500)).thenReturn(response);
+    Mockito.when(response.putHeader("Content-Type", 
"application/json")).thenReturn(response);
+    Mockito.when(routingContext.response()).thenReturn(response);
+
+    handlerHolder.value.handle(routingContext);
+    Mockito.verify(response).end("{\"message\":\"unknown error\"}");
+  }
 }


 

----------------------------------------------------------------
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:
[email protected]


> Request connection is hang up when request path contains illegal string
> -----------------------------------------------------------------------
>
>                 Key: SCB-905
>                 URL: https://issues.apache.org/jira/browse/SCB-905
>             Project: Apache ServiceComb
>          Issue Type: Bug
>            Reporter: YaoHaishi
>            Assignee: YaoHaishi
>            Priority: Major
>
> When provider receives a request that contains illegal path params like 
> "%%E", an Exception
> java.lang.NumberFormatException: For input string: "%E"
> is thrown and no response is sent. On consumer side it seems like that the 
> request connection is hang up until the request timed out.
> The root cause is that there is no failure handler to handle the 
> NumberFormatException. As a result, the request process is interrupted and no 
> response is returned.
> Usually it only happens in EdgeService because for 
> Router.routeWithRegex(String) the % encoded string is decoded like above, 
> while for Router.route() the path is not processed in such way. In 
> EdgeService, routeWithRegex() is usually used, and in normal provide, we use 
> route() instead.



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

Reply via email to