Commit 8f75d9b3 by guojuxing

异常类调整

parent 05ddcb12
package com.gic.store.exception;
/**
* 自定义异常code和message
* @ClassName: StoreException

* @Description: 
 自定义异常code和message
* @author guojuxing

* @date 2019/6/26 2:03 PM
*/
public class StoreException extends RuntimeException{
private String errorCode;
public StoreException(String errorCode, String message) {
super(message);
this.errorCode = errorCode;
}
public String getErrorCode() {
return errorCode;
}
}
package com.gic.store.exception;
/**
* 门店分组自定义异常code和message
* @ClassName: StoreGroupException

* @Description: 
 门店分组自定义异常code和message
* @author guojuxing

* @date 2019/6/26 2:03 PM
*/
public class StoreGroupException extends RuntimeException{
private String errorCode;
public StoreGroupException(String errorCode, String message) {
super(message);
this.errorCode = errorCode;
}
public String getErrorCode() {
return errorCode;
}
}
package com.gic.store.utils;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.store.exception.StoreException;
import com.gic.enterprise.exception.CommonException;
/**
* controller端统一返回工具方法
......@@ -16,7 +16,7 @@ public class CommonResultControllerUtils {
if (response.isSuccess()) {
return response.getResult();
} else {
throw new StoreException(response.getCode(), response.getMessage());
throw new CommonException(response.getCode(), response.getMessage());
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment