-
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.
feat(#53): converted common Exception classes java to kotlin
- Loading branch information
1 parent
c1dc055
commit e03631d
Showing
27 changed files
with
104 additions
and
199 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
29 changes: 0 additions & 29 deletions
29
archive-common/src/main/java/site/archive/common/exception/BaseException.java
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
archive-common/src/main/java/site/archive/common/exception/BaseException.kt
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,23 @@ | ||
package site.archive.common.exception | ||
|
||
import java.util.Optional | ||
|
||
open class BaseException : RuntimeException { | ||
|
||
val exceptionCode: ExceptionCode | ||
private var additionalMessage: String? = null | ||
|
||
constructor(exceptionCode: ExceptionCode) : super(exceptionCode.message) { | ||
this.exceptionCode = exceptionCode | ||
} | ||
|
||
constructor(additionalMessage: String?, exceptionCode: ExceptionCode) : super("${exceptionCode.message} : $additionalMessage") { | ||
this.exceptionCode = exceptionCode | ||
this.additionalMessage = additionalMessage | ||
} | ||
|
||
fun getAdditionalMessage(): Optional<String> { | ||
return Optional.ofNullable(additionalMessage) | ||
} | ||
|
||
} |
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: 0 additions & 15 deletions
15
...mmon/src/main/java/site/archive/common/exception/common/DuplicateFieldValueException.java
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
...common/src/main/java/site/archive/common/exception/common/DuplicateFieldValueException.kt
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 site.archive.common.exception.common | ||
|
||
import site.archive.common.exception.BaseException | ||
import site.archive.common.exception.ExceptionCode | ||
|
||
class DuplicateFieldValueException(duplicatedField: String, duplicatedValue: String) : | ||
BaseException( | ||
"'$duplicatedValue'은 중복된 $duplicatedField 입니다. 다른 $duplicatedField 을 사용해주세요", | ||
ExceptionCode.DUPLICATED_FIELD_VALUE | ||
) |
12 changes: 0 additions & 12 deletions
12
...common/src/main/java/site/archive/common/exception/common/DuplicateResourceException.java
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...e-common/src/main/java/site/archive/common/exception/common/DuplicateResourceException.kt
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,6 @@ | ||
package site.archive.common.exception.common | ||
|
||
import site.archive.common.exception.BaseException | ||
import site.archive.common.exception.ExceptionCode | ||
|
||
class DuplicateResourceException(duplicatedResource: String) : BaseException(duplicatedResource, ExceptionCode.DUPLICATED_RESOURCE) |
17 changes: 0 additions & 17 deletions
17
...-common/src/main/java/site/archive/common/exception/common/ResourceNotFoundException.java
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...ve-common/src/main/java/site/archive/common/exception/common/ResourceNotFoundException.kt
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,6 @@ | ||
package site.archive.common.exception.common | ||
|
||
import site.archive.common.exception.BaseException | ||
import site.archive.common.exception.ExceptionCode | ||
|
||
class ResourceNotFoundException(notFoundMessage: String) : BaseException(notFoundMessage, ExceptionCode.NOT_FOUND_RESOURCE) |
17 changes: 0 additions & 17 deletions
17
...mon/src/main/java/site/archive/common/exception/common/UnauthorizedResourceException.java
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...ommon/src/main/java/site/archive/common/exception/common/UnauthorizedResourceException.kt
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,6 @@ | ||
package site.archive.common.exception.common | ||
|
||
import site.archive.common.exception.BaseException | ||
import site.archive.common.exception.ExceptionCode | ||
|
||
class UnauthorizedResourceException(message: String) : BaseException(message, ExceptionCode.UNAUTHORIZED_RESOURCE) |
12 changes: 0 additions & 12 deletions
12
archive-common/src/main/java/site/archive/common/exception/infra/FileInvalidException.java
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
archive-common/src/main/java/site/archive/common/exception/infra/FileInvalidException.kt
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,6 @@ | ||
package site.archive.common.exception.infra | ||
|
||
import site.archive.common.exception.BaseException | ||
import site.archive.common.exception.ExceptionCode | ||
|
||
class FileInvalidException : BaseException(ExceptionCode.FAILED_FILE_UPLOAD) |
9 changes: 0 additions & 9 deletions
9
archive-common/src/main/java/site/archive/common/exception/infra/SlackException.java
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
archive-common/src/main/java/site/archive/common/exception/infra/SlackException.kt
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,6 @@ | ||
package site.archive.common.exception.infra | ||
|
||
import site.archive.common.exception.BaseException | ||
import site.archive.common.exception.ExceptionCode | ||
|
||
class SlackException : BaseException(ExceptionCode.SLACK_MESSAGE_FAILED) |
12 changes: 0 additions & 12 deletions
12
...ve-common/src/main/java/site/archive/common/exception/security/InvalidTokenException.java
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
archive-common/src/main/java/site/archive/common/exception/security/InvalidTokenException.kt
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,6 @@ | ||
package site.archive.common.exception.security | ||
|
||
import site.archive.common.exception.BaseException | ||
import site.archive.common.exception.ExceptionCode | ||
|
||
class InvalidTokenException : BaseException(ExceptionCode.INVALID_TOKEN) |
11 changes: 0 additions & 11 deletions
11
...e-common/src/main/java/site/archive/common/exception/security/TokenNotFoundException.java
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...ive-common/src/main/java/site/archive/common/exception/security/TokenNotFoundException.kt
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,6 @@ | ||
package site.archive.common.exception.security | ||
|
||
import site.archive.common.exception.BaseException | ||
import site.archive.common.exception.ExceptionCode | ||
|
||
class TokenNotFoundException : BaseException(ExceptionCode.TOKEN_NOT_FOUND) |
12 changes: 0 additions & 12 deletions
12
archive-common/src/main/java/site/archive/common/exception/user/LoginFailException.java
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
archive-common/src/main/java/site/archive/common/exception/user/LoginFailException.kt
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,6 @@ | ||
package site.archive.common.exception.user | ||
|
||
import site.archive.common.exception.BaseException | ||
import site.archive.common.exception.ExceptionCode | ||
|
||
class LoginFailException(message: String) : BaseException(message, ExceptionCode.LOGIN_FAIL) |
13 changes: 0 additions & 13 deletions
13
...e-common/src/main/java/site/archive/common/exception/user/OAuthRegisterFailException.java
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...ive-common/src/main/java/site/archive/common/exception/user/OAuthRegisterFailException.kt
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,7 @@ | ||
package site.archive.common.exception.user | ||
|
||
import site.archive.common.exception.BaseException | ||
import site.archive.common.exception.ExceptionCode | ||
|
||
class OAuthRegisterFailException(oAuthProviderRegistrationId: String, message: String) : | ||
BaseException("$oAuthProviderRegistrationId : $message", ExceptionCode.REGISTER_FAIL) |
12 changes: 0 additions & 12 deletions
12
...on/src/main/java/site/archive/common/exception/user/OAuthUserHasNotPasswordException.java
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...mmon/src/main/java/site/archive/common/exception/user/OAuthUserHasNotPasswordException.kt
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,7 @@ | ||
package site.archive.common.exception.user | ||
|
||
import site.archive.common.exception.BaseException | ||
import site.archive.common.exception.ExceptionCode | ||
|
||
class OAuthUserHasNotPasswordException : BaseException(ExceptionCode.OAUTH_USER_NOT_HAS_PASSWORD) { | ||
} |
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