보안점검 소스 수정(module-common)
This commit is contained in:
@@ -4,6 +4,7 @@ plugins {
|
||||
// querydsl
|
||||
id 'com.ewerk.gradle.plugins.querydsl' version '1.0.10'
|
||||
id 'java'
|
||||
id "org.sonarqube" version "2.7"
|
||||
}
|
||||
|
||||
group 'org.egovframe.cloud'
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ErrorResponse {
|
||||
this.message = messageSource.getMessage(code.getMessage(), new Object[]{}, DEFAULT_ERROR_MESSAGE, LocaleContextHolder.getLocale());
|
||||
this.status = code.getStatus();
|
||||
this.code = code.getCode();
|
||||
this.errors = errors;
|
||||
this.errors = new ArrayList<>(errors);
|
||||
}
|
||||
|
||||
private ErrorResponse(final ErrorCode code, MessageSource messageSource) {
|
||||
@@ -125,8 +125,12 @@ public class ErrorResponse {
|
||||
* @return
|
||||
*/
|
||||
public static ErrorResponse of(MethodArgumentTypeMismatchException e, MessageSource messageSource) {
|
||||
final String value = e.getValue() == null ? "" : e.getValue().toString();
|
||||
final List<ErrorResponse.FieldError> errors = ErrorResponse.FieldError.of(e.getName(), value, e.getErrorCode());
|
||||
if (e.getValue() == null) {
|
||||
return new ErrorResponse(ErrorCode.INVALID_TYPE_VALUE, ErrorResponse.FieldError.of(e.getName(), "", e.getErrorCode()), messageSource);
|
||||
}
|
||||
|
||||
final List<ErrorResponse.FieldError> errors =
|
||||
ErrorResponse.FieldError.of(e.getName(), String.valueOf(e.getValue()), e.getErrorCode());
|
||||
return new ErrorResponse(ErrorCode.INVALID_TYPE_VALUE, errors, messageSource);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user