自动化立体仓库 - WMS系统
王佳豪
2021-06-03 f66b98a1be56a35e4fc46c22c46fd126657becb9
src/main/java/com/zy/asrs/task/AbstractHandler.java
@@ -1,5 +1,11 @@
package com.zy.asrs.task;
import com.core.exception.CoolException;
import com.zy.asrs.task.core.AsrsException;
import com.zy.asrs.task.core.ReturnT;
import java.text.MessageFormat;
/**
 * Created by vincent on 2020/7/4
 */
@@ -8,10 +14,14 @@
    public final ReturnT<T> SUCCESS = new ReturnT<>(200, null);
    public final ReturnT<T> FAIL = new ReturnT<>(500, null);
    protected abstract ReturnT<T> start();
//    protected abstract ReturnT<T> start();
    protected void exceptionHandle(String errorMsg){
        throw new AsrsException(errorMsg);
        exceptionHandle(errorMsg, (Object) null);
    }
    protected void exceptionHandle(String errorMsg, Object... args){
        throw new CoolException(MessageFormat.format(errorMsg, args));
    }
}