package com.activiti6.common.exception;

import com.activiti6.entity.AjaxEntityVo;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyControllerAdvice {

    @ExceptionHandler(value = Exception.class)
    public AjaxEntityVo success(Exception e){
        e.printStackTrace();
        AjaxEntityVo ajaxEntityVo=new AjaxEntityVo();
        ajaxEntityVo.setCode(1);
        ajaxEntityVo.setMsg(e.getMessage());
        return  ajaxEntityVo;
    }
}
