package com.controller;

import com.exception.MyException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

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

@Controller
public class ExceptionTestController {
    @RequestMapping("/exception1")
    @ResponseBody // 异常测试
    public Map exception1() {
        HashMap stringStringHashMap = new HashMap<String, String>();
        stringStringHashMap.put("1","2");
        throw new MyException();
//        return stringStringHashMap;
    }
}
