-
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.
Merge pull request #21 from EntryDSM/feature/19-exception-handling
Feature/19 exception handling
- Loading branch information
Showing
34 changed files
with
175 additions
and
84 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...ry/dsm/gitauth/equusgithubauth/domain/auth/exception/AuthorizedClientNotFoundException.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 entry.dsm.gitauth.equusgithubauth.domain.auth.exception | ||
|
||
import entry.dsm.gitauth.equusgithubauth.global.exception.CustomException | ||
import entry.dsm.gitauth.equusgithubauth.global.exception.ErrorCode | ||
|
||
object AuthorizedClientNotFoundException : CustomException(ErrorCode.AUTHORIZED_CLIENT_NOT_FOUND) |
6 changes: 6 additions & 0 deletions
6
...tlin/entry/dsm/gitauth/equusgithubauth/domain/auth/exception/EmptyAccessTokenException.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 entry.dsm.gitauth.equusgithubauth.domain.auth.exception | ||
|
||
import entry.dsm.gitauth.equusgithubauth.global.exception.CustomException | ||
import entry.dsm.gitauth.equusgithubauth.global.exception.ErrorCode | ||
|
||
object EmptyAccessTokenException : CustomException(ErrorCode.EMPTY_ACCESS_TOKEN) |
6 changes: 6 additions & 0 deletions
6
...in/entry/dsm/gitauth/equusgithubauth/domain/auth/exception/InvalidAccessTokenException.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 entry.dsm.gitauth.equusgithubauth.domain.auth.exception | ||
|
||
import entry.dsm.gitauth.equusgithubauth.global.exception.CustomException | ||
import entry.dsm.gitauth.equusgithubauth.global.exception.ErrorCode | ||
|
||
object InvalidAccessTokenException : CustomException(ErrorCode.INVALID_ACCESS_TOKEN) |
6 changes: 6 additions & 0 deletions
6
...ry/dsm/gitauth/equusgithubauth/domain/auth/exception/MissingRequiredAttributeException.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 entry.dsm.gitauth.equusgithubauth.domain.auth.exception | ||
|
||
import entry.dsm.gitauth.equusgithubauth.global.exception.CustomException | ||
import entry.dsm.gitauth.equusgithubauth.global.exception.ErrorCode | ||
|
||
object MissingRequiredAttributeException : CustomException(ErrorCode.MISSING_REQUIRED_ATTRIBUTE) |
6 changes: 6 additions & 0 deletions
6
...dsm/gitauth/equusgithubauth/domain/auth/exception/OrganizationMembershipErrorException.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 entry.dsm.gitauth.equusgithubauth.domain.auth.exception | ||
|
||
import entry.dsm.gitauth.equusgithubauth.global.exception.CustomException | ||
import entry.dsm.gitauth.equusgithubauth.global.exception.ErrorCode | ||
|
||
object OrganizationMembershipErrorException : CustomException(ErrorCode.ORGANIZATION_MEMBERSHIP_ERROR) |
6 changes: 6 additions & 0 deletions
6
...ntry/dsm/gitauth/equusgithubauth/domain/auth/exception/TokenExpirationMissingException.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 entry.dsm.gitauth.equusgithubauth.domain.auth.exception | ||
|
||
import entry.dsm.gitauth.equusgithubauth.global.exception.CustomException | ||
import entry.dsm.gitauth.equusgithubauth.global.exception.ErrorCode | ||
|
||
object TokenExpirationMissingException : CustomException(ErrorCode.TOKEN_EXPIRATION_MISSING) |
6 changes: 6 additions & 0 deletions
6
.../entry/dsm/gitauth/equusgithubauth/domain/auth/exception/UserInfoFetchFailureException.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 entry.dsm.gitauth.equusgithubauth.domain.auth.exception | ||
|
||
import entry.dsm.gitauth.equusgithubauth.global.exception.CustomException | ||
import entry.dsm.gitauth.equusgithubauth.global.exception.ErrorCode | ||
|
||
object UserInfoFetchFailureException : CustomException(ErrorCode.USER_INFO_FETCH_ERROR) |
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
6 changes: 6 additions & 0 deletions
6
...tlin/entry/dsm/gitauth/equusgithubauth/domain/notice/exception/NoticeNotFoundException.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 entry.dsm.gitauth.equusgithubauth.domain.notice.exception | ||
|
||
import entry.dsm.gitauth.equusgithubauth.global.exception.CustomException | ||
import entry.dsm.gitauth.equusgithubauth.global.exception.ErrorCode | ||
|
||
object NoticeNotFoundException : CustomException(ErrorCode.NOTICE_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
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
6 changes: 6 additions & 0 deletions
6
...tlin/entry/dsm/gitauth/equusgithubauth/domain/report/exception/ReportNotFoundException.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 entry.dsm.gitauth.equusgithubauth.domain.report.exception | ||
|
||
import entry.dsm.gitauth.equusgithubauth.global.exception.CustomException | ||
import entry.dsm.gitauth.equusgithubauth.global.exception.ErrorCode | ||
|
||
object ReportNotFoundException : CustomException(ErrorCode.REPORT_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
6 changes: 0 additions & 6 deletions
6
...n/kotlin/entry/dsm/gitauth/equusgithubauth/domain/user/exception/InvalidTokenException.kt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...n/kotlin/entry/dsm/gitauth/equusgithubauth/domain/user/exception/UserNotFoundException.kt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/main/kotlin/entry/dsm/gitauth/equusgithubauth/global/error/ErrorResponse.kt
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
...main/kotlin/entry/dsm/gitauth/equusgithubauth/global/error/exception/BusinessException.kt
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/main/kotlin/entry/dsm/gitauth/equusgithubauth/global/error/exception/ErrorCode.kt
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/main/kotlin/entry/dsm/gitauth/equusgithubauth/global/exception/CustomException.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,8 @@ | ||
package entry.dsm.gitauth.equusgithubauth.global.exception | ||
|
||
abstract class CustomException( | ||
private val errorCode: ErrorCode, | ||
) : RuntimeException() { | ||
val statusCode: Int get() = errorCode.status | ||
override val message: String get() = errorCode.message | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/kotlin/entry/dsm/gitauth/equusgithubauth/global/exception/ErrorCode.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,22 @@ | ||
package entry.dsm.gitauth.equusgithubauth.global.exception | ||
|
||
enum class ErrorCode( | ||
val status: Int, | ||
val message: String, | ||
) { | ||
USER_NOT_FOUND(404, "사용자를 찾을 수 없습니다."), | ||
USER_INFO_FETCH_ERROR(500, "GitHub 사용자 정보를 가져올 수 없습니다."), | ||
AUTHORIZED_CLIENT_NOT_FOUND(400, "사용자에 대한 인증된 클라이언트를 찾을 수 없습니다."), | ||
ORGANIZATION_MEMBERSHIP_ERROR(400, "사용자가 조직의 멤버가 아닙니다."), | ||
TOKEN_EXPIRATION_MISSING(400, "토큰 만료 시간이 누락되었습니다."), | ||
MISSING_REQUIRED_ATTRIBUTE(400, "사용자의 필수 속성이 누락되었습니다."), | ||
INVALID_ACCESS_TOKEN(400, "액세스 토큰이 만료되었거나 유효하지 않습니다."), | ||
EMPTY_ACCESS_TOKEN(400, "액세스 토큰이 비어 있습니다."), | ||
|
||
NOTICE_NOT_FOUND(404, "공지사항을 찾을 수 없습니다."), | ||
|
||
REPORT_NOT_FOUND(404, "보고서를 찾을 수 없습니다."), | ||
|
||
JWT_TOKEN_EXPIRED(401, "JWT 토큰이 만료되었습니다."), | ||
JWT_TOKEN_INVALID(401, "JWT 토큰이 유효하지 않습니다."), | ||
} |
Oops, something went wrong.