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/18 10:09:37 UTC

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

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

 ##########
 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:
   I want to get the original exception information in the code. This is just printed out in the log. Can you wrap the exception as cause and throw it together in InvocationException?

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