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 2019/10/22 06:51:48 UTC

[GitHub] [servicecomb-java-chassis] yhs0092 commented on a change in pull request #1349: [SCB-1525]print codec error stack

yhs0092 commented on a change in pull request #1349: [SCB-1525]print codec error stack
URL: https://github.com/apache/servicecomb-java-chassis/pull/1349#discussion_r337350856
 
 

 ##########
 File path: common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestCodec.java
 ##########
 @@ -61,7 +64,11 @@ public static void argsToRest(Object[] args, RestOperationMeta restOperation,
       try {
         paramValues[idx] = param.getParamProcessor().getValue(request);
       } catch (Exception e) {
-        // Avoid information leak of user input.
+        // Avoid information leak of user input, and add option for debug use.
+        if (DynamicPropertyFactory.getInstance().getBooleanProperty(
+            RestConst.PRINT_CODEC_ERROR_MESSGAGE, false).get()) {
+          LOG.error("", e);
+        }
 
 Review comment:
   Hi, maybe we can set the raw exception to the cause of the InvocationException?
   See the constructor `InvocationException(int statusCode, String reasonPhrase, Object errorData, Throwable cause)`

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


With regards,
Apache Git Services