Skip to content

Commit

Permalink
예외처리 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ansm6 committed Feb 17, 2023
1 parent c04fe20 commit c8cec61
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/main/java/com/gaaji/auth/exception/AuthErrorCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ public enum AuthErrorCode implements ErrorCode{
AUTH_ID_NOT_FOUND(HttpStatus.UNAUTHORIZED,"A-0001", "등록되지 않은 계정입니다."), // v
Input_Null_Data_On_Review_Id(HttpStatus.INTERNAL_SERVER_ERROR, "r-0001","후기 생성 과정에서 ReviewId에 Null이 입력되었습니다."),
Input_Null_Data_On_Post_Id(HttpStatus.INTERNAL_SERVER_ERROR, "r-0002","후기 생성 과정에서 PostId에 Null이 입력되었습니다."),
No_match_Id(HttpStatus.BAD_REQUEST, "r-0003","후기 등록자의 Id와 일치하는 판매자 또는 구매자의 Id가 없습니다.")
No_match_Id(HttpStatus.BAD_REQUEST, "r-0003","후기 등록자의 Id와 일치하는 판매자 또는 구매자의 Id가 없습니다."),
Nonexistent_Target(HttpStatus.BAD_REQUEST, "r-0004","판매자 또는 구매자의 Id가 없습니다."),
No_Review(HttpStatus.BAD_REQUEST, "r-0005","후기가 없습니다."),
Equals_Seller_And_Purchaser(HttpStatus.BAD_REQUEST, "r-0006","판매자와 구매자가 동일합니다."),
;

private final HttpStatus httpStatus;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.gaaji.auth.exception;

import static com.gaaji.auth.exception.AuthErrorCode.Equals_Seller_And_Purchaser;

public class EqualsSellerAndPurchaserException extends AbstractApiException{

public EqualsSellerAndPurchaserException() {
super(Equals_Seller_And_Purchaser);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import static com.gaaji.auth.exception.AuthErrorCode.No_match_Id;

public class NomatchIdException extends AbstractApiException {
public class NoMatchIdException extends AbstractApiException {

public NomatchIdException() {
public NoMatchIdException() {
super(No_match_Id);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.gaaji.auth.exception;

import static com.gaaji.auth.exception.AuthErrorCode.Nonexistent_Target;

public class NonexistentTargetException extends AbstractApiException {

public NonexistentTargetException() {
super(Nonexistent_Target);
}

}

0 comments on commit c8cec61

Please sign in to comment.