From c9737074f865f594e2506d32d79e607ed9f1ca7d Mon Sep 17 00:00:00 2001 From: dlswns2480 Date: Thu, 21 Dec 2023 16:34:39 +0900 Subject: [PATCH 1/5] =?UTF-8?q?fix=20:=20CommonException=20=ED=81=B4?= =?UTF-8?q?=EB=9E=98=EC=8A=A4=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catchtable/common/exception/CommonException.java | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/main/java/com/prgrms/catchtable/common/exception/CommonException.java diff --git a/src/main/java/com/prgrms/catchtable/common/exception/CommonException.java b/src/main/java/com/prgrms/catchtable/common/exception/CommonException.java new file mode 100644 index 00000000..9004b306 --- /dev/null +++ b/src/main/java/com/prgrms/catchtable/common/exception/CommonException.java @@ -0,0 +1,11 @@ +package com.prgrms.catchtable.common.exception; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public class CommonException extends RuntimeException { + + private final ErrorCode errorCode; +} From 93e9770f9e13f9c19ababf280433e4f7ca337a42 Mon Sep 17 00:00:00 2001 From: dlswns2480 Date: Thu, 21 Dec 2023 16:35:30 +0900 Subject: [PATCH 2/5] =?UTF-8?q?fix=20:=20ErrorCode=20=EC=A0=95=EC=9D=98=20?= =?UTF-8?q?-=20http=20=EC=83=81=ED=83=9C=20=EC=BD=94=EB=93=9C=20-=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=EB=A9=94=EC=84=B8=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catchtable/common/exception/ErrorCode.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/main/java/com/prgrms/catchtable/common/exception/ErrorCode.java diff --git a/src/main/java/com/prgrms/catchtable/common/exception/ErrorCode.java b/src/main/java/com/prgrms/catchtable/common/exception/ErrorCode.java new file mode 100644 index 00000000..eb2e6d67 --- /dev/null +++ b/src/main/java/com/prgrms/catchtable/common/exception/ErrorCode.java @@ -0,0 +1,14 @@ +package com.prgrms.catchtable.common.exception; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; + +@Getter +@RequiredArgsConstructor +public enum ErrorCode { + NOT_EXIST_MEMBER(HttpStatus.BAD_REQUEST, "존재하지 않는 아이디입니다."); + + private final HttpStatus httpStatus; + private final String message; +} From cbbc4c7c1ecef7ab054f69e11f8e9328d86fd130 Mon Sep 17 00:00:00 2001 From: dlswns2480 Date: Thu, 21 Dec 2023 16:35:57 +0900 Subject: [PATCH 3/5] =?UTF-8?q?fix=20:=20ExceptionHandler=20=ED=85=9C?= =?UTF-8?q?=ED=94=8C=EB=A6=BF=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catchtable/common/exception/ExceptionHandler.java | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/main/java/com/prgrms/catchtable/common/exception/ExceptionHandler.java diff --git a/src/main/java/com/prgrms/catchtable/common/exception/ExceptionHandler.java b/src/main/java/com/prgrms/catchtable/common/exception/ExceptionHandler.java new file mode 100644 index 00000000..e80e90fa --- /dev/null +++ b/src/main/java/com/prgrms/catchtable/common/exception/ExceptionHandler.java @@ -0,0 +1,8 @@ +package com.prgrms.catchtable.common.exception; + +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class ExceptionHandler { + +} From 569a77e306d04eaae625f215a8624f51c84f8bd1 Mon Sep 17 00:00:00 2001 From: dlswns2480 Date: Sat, 23 Dec 2023 03:12:04 +0900 Subject: [PATCH 4/5] =?UTF-8?q?feat=20:=20=EC=BB=A4=EC=8A=A4=ED=85=80=20?= =?UTF-8?q?=EC=98=88=EC=99=B8=20=ED=85=9C=ED=94=8C=EB=A6=BF=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20-=20=EA=B8=B0=EC=A1=B4=EC=97=90=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=ED=95=9C=20=EA=B3=B5=ED=86=B5=20=EC=98=88=EC=99=B8(Co?= =?UTF-8?q?mmonException)=20=ED=81=B4=EB=9E=98=EC=8A=A4=EB=A5=BC=20?= =?UTF-8?q?=EC=83=81=EC=86=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exception/custom/BadRequestCustomException.java | 11 +++++++++++ .../exception/custom/NotFoundCustomException.java | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/main/java/com/prgrms/catchtable/common/exception/custom/BadRequestCustomException.java create mode 100644 src/main/java/com/prgrms/catchtable/common/exception/custom/NotFoundCustomException.java diff --git a/src/main/java/com/prgrms/catchtable/common/exception/custom/BadRequestCustomException.java b/src/main/java/com/prgrms/catchtable/common/exception/custom/BadRequestCustomException.java new file mode 100644 index 00000000..e173a35c --- /dev/null +++ b/src/main/java/com/prgrms/catchtable/common/exception/custom/BadRequestCustomException.java @@ -0,0 +1,11 @@ +package com.prgrms.catchtable.common.exception.custom; + +import com.prgrms.catchtable.common.exception.CommonException; +import com.prgrms.catchtable.common.exception.ErrorCode; + +public class BadRequestCustomException extends CommonException { + + public BadRequestCustomException(ErrorCode errorCode) { + super(errorCode); + } +} diff --git a/src/main/java/com/prgrms/catchtable/common/exception/custom/NotFoundCustomException.java b/src/main/java/com/prgrms/catchtable/common/exception/custom/NotFoundCustomException.java new file mode 100644 index 00000000..645f0d5e --- /dev/null +++ b/src/main/java/com/prgrms/catchtable/common/exception/custom/NotFoundCustomException.java @@ -0,0 +1,11 @@ +package com.prgrms.catchtable.common.exception.custom; + +import com.prgrms.catchtable.common.exception.CommonException; +import com.prgrms.catchtable.common.exception.ErrorCode; + +public class NotFoundCustomException extends CommonException { + + public NotFoundCustomException(ErrorCode errorCode) { + super(errorCode); + } +} From 7a12e9411753bd969dc4bf09a5373630bd25705d Mon Sep 17 00:00:00 2001 From: dlswns2480 Date: Mon, 25 Dec 2023 15:20:55 +0900 Subject: [PATCH 5/5] =?UTF-8?q?feat=20:=20ErrorCode=20=EC=83=81=ED=83=9C?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=ED=95=84=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/prgrms/catchtable/common/exception/ErrorCode.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/prgrms/catchtable/common/exception/ErrorCode.java b/src/main/java/com/prgrms/catchtable/common/exception/ErrorCode.java index eb2e6d67..876f8b79 100644 --- a/src/main/java/com/prgrms/catchtable/common/exception/ErrorCode.java +++ b/src/main/java/com/prgrms/catchtable/common/exception/ErrorCode.java @@ -2,13 +2,11 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; -import org.springframework.http.HttpStatus; @Getter @RequiredArgsConstructor public enum ErrorCode { - NOT_EXIST_MEMBER(HttpStatus.BAD_REQUEST, "존재하지 않는 아이디입니다."); + NOT_EXIST_MEMBER("존재하지 않는 아이디입니다."); - private final HttpStatus httpStatus; private final String message; }