// Path: SpringBoot-GlobalExceptionHandler/src/main/java/com/lengchuan/springBoot/Exception/MyException1.java
// public class MyException1 extends Exception {
//     public MyException1() {
//         super();
//     }
// 
//     public MyException1(String msg) {
//         super(msg);
//     }
// }


import com.lengchuan.springBoot.Exception.MyException1;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
package com.lengchuan.springBoot.controller;


/**
 * @author lengchuan <lishuijun1992@gmail.com>
 * @date 17-3-27
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    @RequestMapping("/default")
    public String defaultException() {
        throw new NullPointerException();
    }

    @RequestMapping("/my")
    public String MyException() throws MyException1 {
// Path: SpringBoot-GlobalExceptionHandler/src/main/java/com/lengchuan/springBoot/Exception/MyException1.java
// public class MyException1 extends Exception {
//     public MyException1() {
//         super();
//     }
// 
//     public MyException1(String msg) {
//         super(msg);
//     }
// }


// Path: SpringBoot-GlobalExceptionHandler/src/main/java/com/lengchuan/springBoot/controller/DemoController.java
import com.lengchuan.springBoot.Exception.MyException1;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

package com.lengchuan.springBoot.controller;


/**
 * @author lengchuan <lishuijun1992@gmail.com>
 * @date 17-3-27
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    @RequestMapping("/default")
    public String defaultException() {
        throw new NullPointerException();
    }

    @RequestMapping("/my")
    public String MyException() throws MyException1 {
        throw new MyException1();