package com.sys.core;

import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;

public class UnifyThrowEcxp {
	/** 
     * 统一抛异常- maps里面可自定义异常参数 
     */  
    public static void throwExcp(Exception e, Map<String, Object> maps) {  
        Map<String, String> map = new HashMap<String, String>();  
        map.put("msg", e.getMessage());  
        map.put("text", e.getMessage());  
        if (!maps.isEmpty()) {  
            map.put("errMsg", JSONObject.toJSONString(maps));  
        }  
        throw new RuntimeException(JSONObject.toJSONString(map));  
    }  
}
