|
|
@ -79,16 +79,24 @@ public class CustomRestExceptionHandler extends ResponseEntityExceptionHandler {
|
|
|
|
log.error("{}", validErrorMap);
|
|
|
|
log.error("{}", validErrorMap);
|
|
|
|
log.error("##############################################################################################");
|
|
|
|
log.error("##############################################################################################");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Optional<String> firstKey = validErrorMap
|
|
|
|
|
|
|
|
.keySet()
|
|
|
|
|
|
|
|
.stream()
|
|
|
|
|
|
|
|
.findFirst();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Optional<String> firstMessage = validErrorMap
|
|
|
|
Optional<String> firstMessage = validErrorMap
|
|
|
|
.values()
|
|
|
|
.values()
|
|
|
|
.stream()
|
|
|
|
.stream()
|
|
|
|
.findFirst();
|
|
|
|
.findFirst();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String errMsg = "["+firstKey.orElse("에러 메세지가 정의 되지 않았습니다")+"] "+firstMessage.orElse("");
|
|
|
|
|
|
|
|
|
|
|
|
RestErrorResponse errorResponse = RestErrorResponse.builder()
|
|
|
|
RestErrorResponse errorResponse = RestErrorResponse.builder()
|
|
|
|
.status(HttpStatus.BAD_REQUEST.value())
|
|
|
|
.status(HttpStatus.BAD_REQUEST.value())
|
|
|
|
.error(HttpStatus.BAD_REQUEST.name())
|
|
|
|
.error(HttpStatus.BAD_REQUEST.name())
|
|
|
|
.code(HttpStatus.BAD_REQUEST.name())
|
|
|
|
.code(HttpStatus.BAD_REQUEST.name())
|
|
|
|
.message(firstMessage.orElse("에러 메세지가 정의 되지 않았습니다"))
|
|
|
|
.message(errMsg)
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
|
|
log.error("##############################################################################################");
|
|
|
|
log.error("##############################################################################################");
|
|
|
|