1.自定义异常&在表现层抛出:
1.1自定义业务异常:
package com.tang.exception;
public class BusinessException extends RuntimeException {
private Integer code;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public BusinessException (Integer code,String message){
super(message);
this.code = code;
}
public BusinessException (Integer code,String message,Throwable cause){
super(message,cause);
this.code=code;
}
}
1.2自定义系统异常:
package com.tang.exception;
public class SystemException extends RuntimeException {
private Integer code;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {