|
|
@ -10,6 +10,7 @@ package com.epmet.commons.tools.exception; |
|
|
|
|
|
|
|
|
|
|
|
import com.epmet.commons.tools.utils.MessageUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
|
|
/** |
|
|
|
* 自定义异常 |
|
|
@ -42,9 +43,19 @@ public class RenException extends RuntimeException { |
|
|
|
public RenException(int code, Throwable e, String... params) { |
|
|
|
super(e); |
|
|
|
this.code = code; |
|
|
|
this.msg = MessageUtils.getMessage(code, params); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public RenException(int code, String msg){ |
|
|
|
this.code = code; |
|
|
|
if(StringUtils.isBlank(msg)){ |
|
|
|
this.msg = MessageUtils.getMessage(code, msg); |
|
|
|
}else{ |
|
|
|
this.msg = msg; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public RenException(String msg) { |
|
|
|
super(msg); |
|
|
|
this.code = ErrorCode.INTERNAL_SERVER_ERROR; |
|
|
|