
package com.jeelowcode.framework.exception;


import cn.hutool.json.JSONUtil;

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

/**
 * 自定义异常-详细错误信息
 */
public class JeeLowCodeMoreException extends RuntimeException {
    public JeeLowCodeMoreException(String title,String message) {
        if(message==null){
            message="";
        }
        if(message.startsWith("\r\n")){
            message=message.substring(2);
        }

        Map<String,String> map=new HashMap<>();
        map.put("title",title);
        map.put("e",message);
        String jsonStr = JSONUtil.toJsonStr(map);
        throw new JeeLowCodeMoreException(jsonStr);
    }
    private JeeLowCodeMoreException(String message) {
        super(message);
    }
}
