You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2020/04/09 11:33:30 UTC

[servicecomb-java-chassis] branch master updated: [SCB-1859] modify sdk error msg

This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
     new e5efa35  [SCB-1859] modify sdk error msg
e5efa35 is described below

commit e5efa3586e4b3ffe6fec1bfd0a89febc285ae4e6
Author: heyile <25...@qq.com>
AuthorDate: Wed Apr 8 21:26:50 2020 +0800

    [SCB-1859] modify sdk error msg
---
 .../servicecomb/common/rest/TestAbstractRestInvocation.java       | 2 +-
 .../core/handler/impl/TestSimpleLoadBalanceHandler.java           | 2 +-
 .../apache/servicecomb/loadbalance/TestLoadbalanceHandler.java    | 2 +-
 .../swagger/invocation/exception/ExceptionFactory.java            | 4 ++--
 .../src/test/java/org/apache/servicecomb/core/TestResponse.java   | 8 ++++----
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/TestAbstractRestInvocation.java b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/TestAbstractRestInvocation.java
index a92ec6e..e519e76 100644
--- a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/TestAbstractRestInvocation.java
+++ b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/TestAbstractRestInvocation.java
@@ -1105,7 +1105,7 @@ public class TestAbstractRestInvocation {
     restInvocation.scheduleInvocation();
 
     assertEquals(Integer.valueOf(590), status.value);
-    assertEquals("Cse Internal Server Error", reasonPhrase.value);
+    assertEquals("Unexpected producer error, please check logs for details", reasonPhrase.value);
     assertEquals(Integer.valueOf(1), endCount.value);
   }
 
diff --git a/core/src/test/java/org/apache/servicecomb/core/handler/impl/TestSimpleLoadBalanceHandler.java b/core/src/test/java/org/apache/servicecomb/core/handler/impl/TestSimpleLoadBalanceHandler.java
index 3f6c708..8090977 100644
--- a/core/src/test/java/org/apache/servicecomb/core/handler/impl/TestSimpleLoadBalanceHandler.java
+++ b/core/src/test/java/org/apache/servicecomb/core/handler/impl/TestSimpleLoadBalanceHandler.java
@@ -90,7 +90,7 @@ public class TestSimpleLoadBalanceHandler {
     handler.handle(invocation, ar);
 
     Throwable result = response.getResult();
-    Assert.assertEquals("InvocationException: code=490;msg=CommonExceptionData [message=Cse Internal Bad Request]",
+    Assert.assertEquals("InvocationException: code=490;msg=CommonExceptionData [message=Unexpected consumer error, please check logs for details]",
         result.getMessage());
     Assert.assertEquals("No available address found. microserviceName=null, version=null, discoveryGroupName=parent/",
         result.getCause().getMessage());
diff --git a/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadbalanceHandler.java b/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadbalanceHandler.java
index 94f484d..448e454 100644
--- a/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadbalanceHandler.java
+++ b/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadbalanceHandler.java
@@ -224,7 +224,7 @@ public class TestLoadbalanceHandler {
 
     Assert.assertEquals(1,
         loadBalancer.getLoadBalancerStats().getSingleServerStat(server).getSuccessiveConnectionFailureCount());
-    Assert.assertEquals("InvocationException: code=490;msg=CommonExceptionData [message=Cse Internal Bad Request]",
+    Assert.assertEquals("InvocationException: code=490;msg=CommonExceptionData [message=Unexpected consumer error, please check logs for details]",
         result.value.getMessage());
   }
 
diff --git a/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/invocation/exception/ExceptionFactory.java b/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/invocation/exception/ExceptionFactory.java
index 7bdd7f7..b1c6f72 100644
--- a/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/invocation/exception/ExceptionFactory.java
+++ b/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/invocation/exception/ExceptionFactory.java
@@ -32,7 +32,7 @@ public final class ExceptionFactory {
   //    private static final int PROVIDER_INNER_STATUS_CODE = 510;
   public static final int PRODUCER_INNER_STATUS_CODE = 590;
 
-  public static final String PRODUCER_INNER_REASON_PHRASE = "Cse Internal Server Error";
+  public static final String PRODUCER_INNER_REASON_PHRASE = "Unexpected producer error, please check logs for details";
 
   public static final StatusType PRODUCER_INNER_STATUS =
       new HttpStatus(PRODUCER_INNER_STATUS_CODE, PRODUCER_INNER_REASON_PHRASE);
@@ -42,7 +42,7 @@ public final class ExceptionFactory {
   //    private static final int CONSUMER_INNER_STATUS_CODE = 420;
   public static final int CONSUMER_INNER_STATUS_CODE = 490;
 
-  public static final String CONSUMER_INNER_REASON_PHRASE = "Cse Internal Bad Request";
+  public static final String CONSUMER_INNER_REASON_PHRASE = "Unexpected consumer error, please check logs for details";
 
   private static ExceptionToProducerResponseConverters exceptionToProducerResponseConverters = new ExceptionToProducerResponseConverters();
 
diff --git a/swagger/swagger-invocation/invocation-core/src/test/java/org/apache/servicecomb/core/TestResponse.java b/swagger/swagger-invocation/invocation-core/src/test/java/org/apache/servicecomb/core/TestResponse.java
index 9131664..f184bd6 100644
--- a/swagger/swagger-invocation/invocation-core/src/test/java/org/apache/servicecomb/core/TestResponse.java
+++ b/swagger/swagger-invocation/invocation-core/src/test/java/org/apache/servicecomb/core/TestResponse.java
@@ -58,12 +58,12 @@ public class TestResponse {
 
     ar.consumerFail(new RuntimeExceptionWithoutStackTrace("abc"));
     CommonExceptionData data = (CommonExceptionData) ((InvocationException) response.getResult()).getErrorData();
-    Assert.assertEquals("Cse Internal Bad Request", data.getMessage());
+    Assert.assertEquals("Unexpected consumer error, please check logs for details", data.getMessage());
     Assert.assertEquals(ExceptionFactory.CONSUMER_INNER_STATUS_CODE, response.getStatusCode());
 
     ar.fail(InvocationType.CONSUMER, new RuntimeExceptionWithoutStackTrace("abc"));
     data = (CommonExceptionData) ((InvocationException) response.getResult()).getErrorData();
-    Assert.assertEquals("Cse Internal Bad Request", data.getMessage());
+    Assert.assertEquals("Unexpected consumer error, please check logs for details", data.getMessage());
     Assert.assertEquals(ExceptionFactory.CONSUMER_INNER_STATUS_CODE, response.getStatusCode());
 
     InvocationException consumerException = new InvocationException(300, "abc", "def");
@@ -77,12 +77,12 @@ public class TestResponse {
 
     ar.producerFail(new RuntimeExceptionWithoutStackTrace("abc"));
     data = (CommonExceptionData) ((InvocationException) response.getResult()).getErrorData();
-    Assert.assertEquals("Cse Internal Server Error", data.getMessage());
+    Assert.assertEquals("Unexpected producer error, please check logs for details", data.getMessage());
     Assert.assertEquals(ExceptionFactory.PRODUCER_INNER_STATUS_CODE, response.getStatusCode());
 
     ar.fail(InvocationType.PRODUCER, new RuntimeExceptionWithoutStackTrace("abc"));
     data = (CommonExceptionData) ((InvocationException) response.getResult()).getErrorData();
-    Assert.assertEquals("Cse Internal Server Error", data.getMessage());
+    Assert.assertEquals("Unexpected producer error, please check logs for details", data.getMessage());
     Assert.assertEquals(ExceptionFactory.PRODUCER_INNER_STATUS_CODE, response.getStatusCode());
 
     InvocationException producerException = new InvocationException(500, "abc", "def");