package com.chushang.common.mybatis.handler;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.MyBatisSystemException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * by zhaowenyuan create 2022/6/8 18:26
 */
@Slf4j
@RestControllerAdvice
public class MybatisExceptionHandler {

    @ExceptionHandler(MyBatisSystemException.class)
    public void mybatisException(MyBatisSystemException e){
        throw new RuntimeException(e);
    }

}
