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)); } }