package com.ms.biz.common;

import org.springframework.transaction.interceptor.TransactionAspectSupport;

/**
 * 异常管理
 */
public class E {
    public static void throwMSException(String msg) throws MSException {
        throw new MSException(msg);
    }

    public static void throwMSException(String msg,Throwable e) throws MSException {
        throw new MSException(msg, e);
    }

    public static void rollback(){
        try{
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
        }catch (Throwable e){
            e.printStackTrace();
        }
    }
}
