-
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
1 parent
e408684
commit 55ad7ff
Showing
5 changed files
with
155 additions
and
19 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
29 changes: 29 additions & 0 deletions
29
...ain/src/main/java/kr/co/fitapet/domain/domains/device/exception/DeviceTokenErrorCode.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,29 @@ | ||
package kr.co.fitapet.domain.domains.device.exception; | ||
|
||
import kr.co.fitapet.common.execption.BaseErrorCode; | ||
import kr.co.fitapet.common.execption.CausedBy; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import static kr.co.fitapet.common.execption.StatusCode.NOT_FOUND; | ||
|
||
@Getter | ||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE) | ||
public enum DeviceTokenErrorCode implements BaseErrorCode { | ||
/* 404 NOT FOUND */ | ||
NOT_FOUND_DEVICE_TOKEN_ERROR(NOT_FOUND.getCode(), "존재하지 않는 디바이스 토큰입니다."); | ||
|
||
private final int code; | ||
private final String message; | ||
|
||
@Override | ||
public CausedBy causedBy() { | ||
return CausedBy.of(code, name(), message); | ||
} | ||
|
||
@Override | ||
public String getExplainError() throws NoSuchFieldError { | ||
return message; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...rc/main/java/kr/co/fitapet/domain/domains/device/exception/DeviceTokenErrorException.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 kr.co.fitapet.domain.domains.device.exception; | ||
|
||
import kr.co.fitapet.common.execption.BaseErrorCode; | ||
import kr.co.fitapet.common.execption.CausedBy; | ||
import kr.co.fitapet.common.execption.GlobalErrorException; | ||
|
||
public class DeviceTokenErrorException extends GlobalErrorException { | ||
private final DeviceTokenErrorCode errorCode; | ||
|
||
public DeviceTokenErrorException(DeviceTokenErrorCode errorCode) { | ||
super(errorCode); | ||
this.errorCode = errorCode; | ||
} | ||
|
||
public CausedBy causedBy() { | ||
return errorCode.causedBy(); | ||
} | ||
|
||
public BaseErrorCode getErrorCode() { | ||
return errorCode; | ||
} | ||
} |
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