我从控制器抛出异常,如下所示
try {
if (formValidationResult.size() > 0) {
validationResults.put(errorMsg, formValidationResult);
}
} catch (Exception exception) {
LOGGER.error("Error while performing validation in FormController -->"
+ exception.getMessage());
throw new ServiceException(exception.getMessage());
}
if (validationResults.size() > 0) {
throw new ValidationFailureException(validationResults,"Validation Error");
}
在这里我收到一个验证错误;
com.ge.dbt.common.exception.ValidationFailureException:验证错误
我可以包括一个 catch 块来捕捉ValidationFailureException
这里吗?