王佳豪
2021-05-06 b548ff3ac8e3a12bd6e5c95ddd629798b699bb0e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.zy.asrs.task;
 
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
 */
public abstract class AbstractHandler<T> {
 
    public final ReturnT<T> SUCCESS = new ReturnT<>(200, null);
    public final ReturnT<T> FAIL = new ReturnT<>(500, null);
 
//    protected abstract ReturnT<T> start();
 
    protected void exceptionHandle(String errorMsg){
        exceptionHandle(errorMsg, (Object) null);
    }
 
    protected void exceptionHandle(String errorMsg, Object... args){
        throw new AsrsException(MessageFormat.format(errorMsg, args));
    }
 
}