-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: 에러 코드 재정의 Co-authored-by: 3juhwan <[email protected]> * fix: 변수를 받는 예외 메세지 수정 Co-authored-by: 3juhwan <[email protected]> --------- Co-authored-by: kunsanglee <[email protected]> Co-authored-by: Arachne <[email protected]>
- Loading branch information
1 parent
79bd41c
commit 63c93df
Showing
29 changed files
with
156 additions
and
95 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
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
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
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
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
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
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
15 changes: 15 additions & 0 deletions
15
server/src/main/java/server/haengdong/exception/AuthenticationException.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 |
---|---|---|
@@ -1,4 +1,19 @@ | ||
package server.haengdong.exception; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public class AuthenticationException extends RuntimeException { | ||
|
||
private final HaengdongErrorCode errorCode; | ||
private final String message; | ||
|
||
public AuthenticationException(HaengdongErrorCode errorCode) { | ||
this(errorCode, errorCode.getMessage()); | ||
} | ||
|
||
public AuthenticationException(HaengdongErrorCode errorCode, String message) { | ||
this.errorCode = errorCode; | ||
this.message = message; | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
server/src/main/java/server/haengdong/exception/ErrorResponse.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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package server.haengdong.exception; | ||
|
||
public record ErrorResponse( | ||
String code, | ||
HaengdongErrorCode errorCode, | ||
String message | ||
) { | ||
|
||
public static ErrorResponse of(HaengdongErrorCode errorCode) { | ||
return new ErrorResponse(errorCode.getCode(), errorCode.getMessage()); | ||
return new ErrorResponse(errorCode, errorCode.getMessage()); | ||
} | ||
|
||
public static ErrorResponse of(HaengdongErrorCode errorCode, String message){ | ||
return new ErrorResponse(errorCode.getCode(), message); | ||
public static ErrorResponse of(HaengdongErrorCode errorCode, String message) { | ||
return new ErrorResponse(errorCode, message); | ||
} | ||
} |
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
Oops, something went wrong.