Skip to content

Commit 83f631c

Browse files
author
pedro
authored
Merge pull request #10 from TaleLin/fix/exception-message
fix:修复校验异常无法返回正确信息的bug
2 parents 8c7efb6 + 541f1d1 commit 83f631c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/io/github/talelin/merak/common/exception/RestExceptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public UnifyResponseVO processException(ConstraintViolationException exception,
7070
log.error("", exception);
7171
Map<String, Object> msg = new HashMap<>();
7272
exception.getConstraintViolations().forEach(constraintViolation -> {
73-
String template = constraintViolation.getMessageTemplate();
73+
String template = constraintViolation.getMessage();
7474
String path = constraintViolation.getPropertyPath().toString();
7575
msg.put(StrUtil.toUnderlineCase(path), template);
7676
});

0 commit comments

Comments
 (0)