sparkzxl opened a new issue, #10415: URL: https://github.com/apache/dubbo/issues/10415
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy --> - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate. ### Environment * Dubbo version: 3.0.10 * Operating System version: MacOS 12.5 * Java version: 11 ### Steps to reproduce this issue 1. 方法校验结果被ValidationException吞掉了 ### Expected Behavior 我希望能够获取到方法校验参数的具体异常信息 ### Actual Behavior <!-- What actually happens? --> If there is an exception, please attach the exception trace: ``` javax.validation.ValidationException: Failed to validate service: com.github.sparkzxl.auth.api.IDictionaryProvider, method: findDictionaryItemMap, cause: [ConstraintViolationImpl{interpolatedMessage='xxx不能为空', propertyPath=findDictionaryItemMapArgument0, rootBeanClass=class com.github.sparkzxl.auth.api.IDictionaryProvider_FindDictionaryItemMapParameter_java.lang.String_java.util.Set, messageTemplate='xxx不能为空'}] ``` 观看源码得知`ValidationFilter`在进行校验时,会触发`JValidator.validate`方法,该方法在2.7.x版本并没有加上try catch,在目前使用的3.0.10版本上进行了try catch,在不影响校验的同时,是否可以把try catch的范围缩小至以下代码之上 ``` if (!violations.isEmpty()) { logger.info("Failed to validate service: " + clazz.getName() + ", method: " + methodName + ", cause: " + violations); throw new ConstraintViolationException("Failed to validate service: " + clazz.getName() + ", method: " + methodName + ", cause: " + violations, violations); } ```  我希望能够获得ConstraintViolationException异常的信息 -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
