-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
core-module/src/main/java/com/likelion/coremodule/cart/exception/CartErrorCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.likelion.coremodule.cart.exception; | ||
|
||
import com.likelion.commonmodule.exception.common.ApiResponse; | ||
import com.likelion.commonmodule.exception.common.BaseErrorCode; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum CartErrorCode implements BaseErrorCode { | ||
|
||
NO_CART_INFO(HttpStatus.BAD_REQUEST, "2000", "장바구니 안에 상품이 존재하지 않습니다."); | ||
|
||
private final HttpStatus httpStatus; | ||
private final String code; | ||
private final String message; | ||
|
||
|
||
@Override | ||
public ApiResponse<Void> getErrorResponse() { | ||
return null; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
core-module/src/main/java/com/likelion/coremodule/cart/exception/CartException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.likelion.coremodule.cart.exception; | ||
|
||
import com.likelion.commonmodule.exception.common.BaseErrorCode; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class CartException extends RuntimeException { | ||
|
||
private final BaseErrorCode errorCode; | ||
|
||
private final Throwable cause; | ||
|
||
public CartException(BaseErrorCode errorCode) { | ||
this.errorCode = errorCode; | ||
this.cause = null; | ||
} | ||
|
||
public CartException(BaseErrorCode errorCode, Throwable cause) { | ||
this.errorCode = errorCode; | ||
this.cause = cause; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters