// 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.controller2;


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

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

    @RequestMapping("/my")
// 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/controller2/DemoController2.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.controller2;


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

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

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