package com.szxgl.nft.exception;

import com.szxgl.nft.utils.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class MyAjaxExceptionHandler {

    @ExceptionHandler(value = Exception.class)
    public R defaultErrorHandler(Exception e){
        e.printStackTrace();
        return R.error("服务器出现异常!");
    }

    @ExceptionHandler(value = ParameterException.class)
    public R ParameterException(Exception e){
        e.printStackTrace();
        return R.error(e.getMessage());
    }

}
