Helius
2021-06-21 5812839f3e23bb09e1a9b100b63273a646155709
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.xzx.log.util;
 
import cn.hutool.core.exceptions.ExceptionUtil;
import com.xzx.log.exception.BusinessException;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;
 
@Slf4j
@UtilityClass
public class ExceptionUtils {
 
    public void err(Integer code,String msg,Exception e){
        log.error(msg,e);
        throw  new BusinessException(code,msg,ExceptionUtil.getMessage(e));
    }
 
    public void err(String msg,Exception e){
        log.error(msg,e);
        throw  new BusinessException(-1,msg,ExceptionUtil.getMessage(e));
    }
 
 
}