package com.bohuikeji.frame.module.admin.exception;


import com.bohuikeji.frame.module.admin.entity.back.APIEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 异常拦截
 * @author 10552
 */
@Slf4j
@ControllerAdvice
public class ExceptionHandlerAdvice {

    @ResponseBody
    @ExceptionHandler(Exception.class)
    public APIEntity handleException(Exception e){
        return APIEntity.exception(e);
    }

}
