-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* no change * feat: 장애 유형 및 도움 유형에 따른 필터링 추가 * feat: 게시글 예외처리 * feat: 게시글을 찾고 없을 시 예외로 던지는 함수 작성 * feat: 매칭, 매칭 방 예외 처리 * feat: 채팅 메시지 예외처리 * fix: 오류 메시지 수정 * chore: validation 의존성 추가
- Loading branch information
Showing
15 changed files
with
234 additions
and
35 deletions.
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
34 changes: 34 additions & 0 deletions
34
src/main/java/econo/buddybridge/chat/chatmessage/exception/ChatMessageErrorCode.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,34 @@ | ||
package econo.buddybridge.chat.chatmessage.exception; | ||
|
||
import econo.buddybridge.common.exception.ErrorCode; | ||
import org.springframework.http.HttpStatus; | ||
|
||
public enum ChatMessageErrorCode implements ErrorCode { | ||
LAST_CHAT_MESSAGE_NOT_FOUND("CH01", HttpStatus.NOT_FOUND, "마지막 메시지가 존재하지 않습니다."), | ||
; | ||
|
||
private final String code; | ||
private final HttpStatus httpStatus; | ||
private final String message; | ||
|
||
ChatMessageErrorCode(String code, HttpStatus httpStatus, String message) { | ||
this.code = code; | ||
this.httpStatus = httpStatus; | ||
this.message = message; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public HttpStatus getHttpStatus() { | ||
return httpStatus; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return message; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...n/java/econo/buddybridge/chat/chatmessage/exception/LastChatMessageNotFoundException.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,10 @@ | ||
package econo.buddybridge.chat.chatmessage.exception; | ||
|
||
import econo.buddybridge.common.exception.BusinessException; | ||
|
||
public class LastChatMessageNotFoundException extends BusinessException { | ||
|
||
public static BusinessException EXCEPTION = new LastChatMessageNotFoundException(); | ||
|
||
public LastChatMessageNotFoundException() { super(ChatMessageErrorCode.LAST_CHAT_MESSAGE_NOT_FOUND); } | ||
} |
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
35 changes: 35 additions & 0 deletions
35
src/main/java/econo/buddybridge/matching/exception/MatchingErrorCode.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,35 @@ | ||
package econo.buddybridge.matching.exception; | ||
|
||
import econo.buddybridge.common.exception.ErrorCode; | ||
import org.springframework.http.HttpStatus; | ||
|
||
public enum MatchingErrorCode implements ErrorCode { | ||
MATCHING_NOT_FOUND("MA001", HttpStatus.NOT_FOUND, "존재하지 않는 매칭입니다."), | ||
MATCHING_UNAUTHORIZED_ACCESS("MA002", HttpStatus.FORBIDDEN, "사용자가 생성한 매칭방이 아닙니다.") | ||
; | ||
|
||
private final String code; | ||
private final HttpStatus httpStatus; | ||
private final String message; | ||
|
||
MatchingErrorCode(String code, HttpStatus httpStatus, String message) { | ||
this.code = code; | ||
this.httpStatus = httpStatus; | ||
this.message = message; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public HttpStatus getHttpStatus() { | ||
return httpStatus; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return message; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/econo/buddybridge/matching/exception/MatchingNotFoundException.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,11 @@ | ||
package econo.buddybridge.matching.exception; | ||
|
||
import econo.buddybridge.common.exception.BusinessException; | ||
|
||
public class MatchingNotFoundException extends BusinessException { | ||
|
||
public static BusinessException EXCEPTION = new MatchingNotFoundException(); | ||
|
||
private MatchingNotFoundException() { super(MatchingErrorCode.MATCHING_NOT_FOUND); } | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/econo/buddybridge/matching/exception/MatchingUnauthorizedAccessException.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,10 @@ | ||
package econo.buddybridge.matching.exception; | ||
|
||
import econo.buddybridge.common.exception.BusinessException; | ||
|
||
public class MatchingUnauthorizedAccessException extends BusinessException { | ||
|
||
public static BusinessException EXCEPTION = new MatchingUnauthorizedAccessException(); | ||
|
||
public MatchingUnauthorizedAccessException() { super(MatchingErrorCode.MATCHING_UNAUTHORIZED_ACCESS); } | ||
} |
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
11 changes: 11 additions & 0 deletions
11
src/main/java/econo/buddybridge/post/exception/PostDeleteNotAllowedException.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,11 @@ | ||
package econo.buddybridge.post.exception; | ||
|
||
import econo.buddybridge.common.exception.BusinessException; | ||
|
||
public class PostDeleteNotAllowedException extends BusinessException { | ||
public static BusinessException EXCEPTION = new PostDeleteNotAllowedException(); | ||
|
||
private PostDeleteNotAllowedException() { | ||
super(PostErrorCode.POST_DELETE_NOT_ALLOWED); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/econo/buddybridge/post/exception/PostErrorCode.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,39 @@ | ||
package econo.buddybridge.post.exception; | ||
|
||
import econo.buddybridge.common.exception.ErrorCode; | ||
import org.springframework.http.HttpStatus; | ||
|
||
public enum PostErrorCode implements ErrorCode { | ||
// TODO: Implement PostErrorCode | ||
// EX) INVALID_INPUT_VALUE("P001", HttpStatus.BAD_REQUEST, "요청 값이 잘못되었습니다."), | ||
POST_NOT_FOUND("P001", HttpStatus.NOT_FOUND, "존재하지 않는 게시글입니다."), | ||
POST_DELETE_NOT_ALLOWED("P002", HttpStatus.FORBIDDEN, "본인의 게시글만 삭제할 수 있습니다."), | ||
POST_UPDATE_NOT_ALLOWED("P003", HttpStatus.FORBIDDEN, "본인의 게시글만 수정할 수 있습니다."), | ||
POST_UNAUTHORIZED_ACCESS("P004", HttpStatus.BAD_REQUEST, "회원님이 작성한 게시글이 아닙니다."), | ||
; | ||
|
||
private final String code; | ||
private final HttpStatus httpStatus; | ||
private final String message; | ||
|
||
PostErrorCode(String code, HttpStatus httpStatus, String message) { | ||
this.code = code; | ||
this.httpStatus = httpStatus; | ||
this.message = message; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public HttpStatus getHttpStatus() { | ||
return httpStatus; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return message; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/econo/buddybridge/post/exception/PostNotFoundException.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,12 @@ | ||
package econo.buddybridge.post.exception; | ||
|
||
import econo.buddybridge.common.exception.BusinessException; | ||
|
||
public class PostNotFoundException extends BusinessException { | ||
|
||
public static BusinessException EXCEPTION = new PostNotFoundException(); | ||
|
||
private PostNotFoundException() { | ||
super(PostErrorCode.POST_NOT_FOUND); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/econo/buddybridge/post/exception/PostUnauthorizedAccessException.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,10 @@ | ||
package econo.buddybridge.post.exception; | ||
|
||
import econo.buddybridge.common.exception.BusinessException; | ||
|
||
public class PostUnauthorizedAccessException extends BusinessException { | ||
|
||
public static BusinessException EXCEPTION = new PostUnauthorizedAccessException(); | ||
|
||
private PostUnauthorizedAccessException() {super(PostErrorCode.POST_UNAUTHORIZED_ACCESS);} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/econo/buddybridge/post/exception/PostUpdateNotAllowedException.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,11 @@ | ||
package econo.buddybridge.post.exception; | ||
|
||
import econo.buddybridge.common.exception.BusinessException; | ||
|
||
public class PostUpdateNotAllowedException extends BusinessException { | ||
|
||
public static BusinessException EXCEPTION = new PostUpdateNotAllowedException(); | ||
|
||
private PostUpdateNotAllowedException() { super(PostErrorCode.POST_UPDATE_NOT_ALLOWED); } | ||
|
||
} |
Oops, something went wrong.