|
|
|
@ -15,7 +15,7 @@ public class AppException extends RuntimeException {
|
|
|
|
|
|
|
|
|
|
private final Source source; |
|
|
|
|
|
|
|
|
|
private final ExceptionCode errorCode; |
|
|
|
|
private final BaseErrorCode errorCode; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final Object[] paramArray; |
|
|
|
@ -24,7 +24,7 @@ public class AppException extends RuntimeException {
|
|
|
|
|
|
|
|
|
|
private String sourceErrorMessage; |
|
|
|
|
|
|
|
|
|
public AppException(Throwable th, Level level, Source source, ExceptionCode errorCode, Object... paramArray) { |
|
|
|
|
public AppException(Throwable th, Level level, Source source, BaseErrorCode errorCode, Object... paramArray) { |
|
|
|
|
super(th != null ? th.getMessage() : errorCode.message(), th); |
|
|
|
|
this.level = level; |
|
|
|
|
this.errorCode = errorCode; |
|
|
|
@ -34,15 +34,15 @@ public class AppException extends RuntimeException {
|
|
|
|
|
this.sourceErrorMessage = errorCode.message(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public AppException(Throwable th, Level level, ExceptionCode errorCode, Object... paramArray) { |
|
|
|
|
public AppException(Throwable th, Level level, BaseErrorCode errorCode, Object... paramArray) { |
|
|
|
|
this(th, level, Source.INTERNAL, errorCode, paramArray); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public AppException(Throwable th, Source source, ExceptionCode errorCode, Object... paramArray) { |
|
|
|
|
public AppException(Throwable th, Source source, BaseErrorCode errorCode, Object... paramArray) { |
|
|
|
|
this(th, Level.WARN, source, errorCode, paramArray); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public AppException(Throwable th, ExceptionCode errorCode, Object... paramArray) { |
|
|
|
|
public AppException(Throwable th, BaseErrorCode errorCode, Object... paramArray) { |
|
|
|
|
this(th, Level.WARN, Source.INTERNAL, errorCode, paramArray); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -58,30 +58,30 @@ public class AppException extends RuntimeException {
|
|
|
|
|
this(null, Level.WARN, source, errorCode, paramArray); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public AppException(ExceptionCode errorCode, Object... paramArray) { |
|
|
|
|
public AppException(BaseErrorCode errorCode, Object... paramArray) { |
|
|
|
|
this(null, Level.WARN, Source.INTERNAL, errorCode, paramArray); |
|
|
|
|
} |
|
|
|
|
// public BaseException(String errorCode) {
|
|
|
|
|
// this(errorCode, new Object());
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
public AppException(Throwable th, ExceptionCode erorCode, String sourceErrorMessage) { |
|
|
|
|
this(th, Level.WARN, ExceptionCode.INTERNAL_SERVER_ERROR, (Object[])null); |
|
|
|
|
public AppException(Throwable th, BaseErrorCode erorCode, String sourceErrorMessage) { |
|
|
|
|
this(th, Level.WARN, BaseErrorCode.INTERNAL_SERVER_ERROR, (Object[])null); |
|
|
|
|
this.sourceErrorCode = erorCode.code(); |
|
|
|
|
this.sourceErrorMessage = errorCode.message(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public AppException(ExceptionCode sourceErrorCode, String sourceErrorMessage) { |
|
|
|
|
public AppException(BaseErrorCode sourceErrorCode, String sourceErrorMessage) { |
|
|
|
|
this(null, sourceErrorCode, sourceErrorMessage); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Deprecated |
|
|
|
|
public AppException(Throwable th, Level level, ExceptionCode errorCode, Source source, Object... paramArray) { |
|
|
|
|
public AppException(Throwable th, Level level, BaseErrorCode errorCode, Source source, Object... paramArray) { |
|
|
|
|
this(th, level, source, errorCode, paramArray); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Deprecated |
|
|
|
|
public AppException(Level level, ExceptionCode errorCode, Source source, Object... paramArray) { |
|
|
|
|
public AppException(Level level, BaseErrorCode errorCode, Source source, Object... paramArray) { |
|
|
|
|
this(null, level, source, errorCode, paramArray); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -89,7 +89,7 @@ public class AppException extends RuntimeException {
|
|
|
|
|
return errorCode.code(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public ExceptionCode getErrorCode(){ |
|
|
|
|
public BaseErrorCode getErrorCode(){ |
|
|
|
|
return errorCode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -107,14 +107,14 @@ public class AppException extends RuntimeException {
|
|
|
|
|
|
|
|
|
|
public String getErrorMessage(MessageSource ms) { |
|
|
|
|
if (ms == null) { |
|
|
|
|
return ExceptionCode.INTERNAL_SERVER_ERROR.message(); |
|
|
|
|
return BaseErrorCode.INTERNAL_SERVER_ERROR.message(); |
|
|
|
|
} |
|
|
|
|
log.debug("############ getErrorMessage : {}",ms); |
|
|
|
|
log.debug("############ getErrorCode : {}",getCode()); |
|
|
|
|
log.debug("############ getParamArray : {}",getParamArray()); |
|
|
|
|
log.debug("############ ErrorCode.NOT_REGIST_ERROR_CODE.message() : {}",ExceptionCode.NOT_REGIST_ERROR_CODE.message()); |
|
|
|
|
log.debug("############ ErrorCode.NOT_REGIST_ERROR_CODE.message() : {}", BaseErrorCode.NOT_REGIST_ERROR_CODE.message()); |
|
|
|
|
log.debug("############ Locale.getDefault() : {}",Locale.getDefault()); |
|
|
|
|
return ms.getMessage(getCode(), getParamArray(), ExceptionCode.NOT_REGIST_ERROR_CODE.message(), Locale.getDefault()); |
|
|
|
|
return ms.getMessage(getCode(), getParamArray(), BaseErrorCode.NOT_REGIST_ERROR_CODE.message(), Locale.getDefault()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getSourceErrorCode() { |
|
|
|
|