From d5fe4abd47fa7a365839932cba77a96128780ca6 Mon Sep 17 00:00:00 2001 From: youys <1272586223@qq.com> Date: Wed, 17 Aug 2022 11:09:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/net/educoder/handler/GlobalExceptionHandler.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/educoder/handler/GlobalExceptionHandler.java b/src/main/java/net/educoder/handler/GlobalExceptionHandler.java index 581f228..5970b5b 100644 --- a/src/main/java/net/educoder/handler/GlobalExceptionHandler.java +++ b/src/main/java/net/educoder/handler/GlobalExceptionHandler.java @@ -2,7 +2,7 @@ package net.educoder.handler; import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; -import net.educoder.exception.BridgeException; +import net.educoder.exception.BusinessException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; @@ -19,10 +19,10 @@ import org.springframework.web.bind.annotation.ResponseBody; @ControllerAdvice public class GlobalExceptionHandler { - @ExceptionHandler(BridgeException.class) + @ExceptionHandler(BusinessException.class) @ResponseBody - public ResponseEntity handleBridgeExceptions(BridgeException e) { - log.error("捕获到BridgeException", e); + public ResponseEntity handleBridgeExceptions(BusinessException e) { + log.error("捕获到BusinessException", e); JSONObject jsonObj = new JSONObject(); jsonObj.put("code", e.getCode());