package com.pj.current;

import com.pj.utils.SaResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局异常处理
 *
 * @author kong
 * @since 2022-11-22
 */
@RestControllerAdvice
public class HandlerException {

	// 全局异常拦截
	@ExceptionHandler
	public SaResult handlerException(Exception e) {
		e.printStackTrace(); 
		return SaResult.error(e.getMessage());
	}
	
}
