From 90da53bf2b32b3b34fea82f283c200f8aab74085 Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Thu, 29 Dec 2022 17:51:54 +0800 Subject: [PATCH] =?UTF-8?q?AccountLoginException=20=E6=B2=A1=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E8=BE=93=E5=87=BA=E5=A4=AA=E5=A4=9A=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E5=88=9B=E5=BB=BA=E4=B8=80=E4=B8=AA=E6=8B=A6=E6=88=AA?= =?UTF-8?q?=E5=99=A8=E4=B8=93=E9=97=A8=E5=A4=84=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/AccountLoginExceptionHandler.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/exception/handler/AccountLoginExceptionHandler.java diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/exception/handler/AccountLoginExceptionHandler.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/exception/handler/AccountLoginExceptionHandler.java new file mode 100644 index 0000000..81013db --- /dev/null +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/exception/handler/AccountLoginExceptionHandler.java @@ -0,0 +1,26 @@ +package xyz.zhouxy.plusone.system.application.exception.handler; + +import javax.annotation.Nonnull; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import xyz.zhouxy.plusone.exception.handler.BaseExceptionHandler; +import xyz.zhouxy.plusone.system.application.exception.AccountLoginException; +import xyz.zhouxy.plusone.util.RestfulResult; + +@RestControllerAdvice +public class AccountLoginExceptionHandler extends BaseExceptionHandler { + + protected AccountLoginExceptionHandler(ExceptionInfoHolder exceptionInfoHolder) { + super(exceptionInfoHolder); + } + + @ExceptionHandler({ + AccountLoginException.class, + }) + public ResponseEntity handleException(@Nonnull Exception e) { + return buildExceptionResponse(e); + } +}