-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
365b127
commit d5d8c1a
Showing
10 changed files
with
36 additions
and
37 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
4 changes: 1 addition & 3 deletions
4
src/main/kotlin/kr/galaxyhub/sc/common/exception/BadRequestException.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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
package kr.galaxyhub.sc.common.exception | ||
|
||
import kr.galaxyhub.sc.common.support.LogLevel | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.http.HttpStatusCode | ||
|
||
class BadRequestException( | ||
message: String, | ||
httpStatus: HttpStatusCode = HttpStatus.BAD_REQUEST, | ||
logLevel: LogLevel = LogLevel.INFO, | ||
) : GalaxyhubException(message, httpStatus, logLevel) | ||
) : GalaxyhubException(message, httpStatus) |
2 changes: 0 additions & 2 deletions
2
src/main/kotlin/kr/galaxyhub/sc/common/exception/GalaxyhubException.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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
package kr.galaxyhub.sc.common.exception | ||
|
||
import kr.galaxyhub.sc.common.support.LogLevel | ||
import org.springframework.http.HttpStatusCode | ||
|
||
sealed class GalaxyhubException( | ||
message: String, | ||
val httpStatus: HttpStatusCode, | ||
val logLevel: LogLevel, | ||
) : RuntimeException(message) |
4 changes: 1 addition & 3 deletions
4
src/main/kotlin/kr/galaxyhub/sc/common/exception/InternalServerError.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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
package kr.galaxyhub.sc.common.exception | ||
|
||
import kr.galaxyhub.sc.common.support.LogLevel | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.http.HttpStatusCode | ||
|
||
class InternalServerError( | ||
message: String, | ||
httpStatus: HttpStatusCode = HttpStatus.INTERNAL_SERVER_ERROR, | ||
logLevel: LogLevel = LogLevel.WARN, | ||
) : GalaxyhubException(message, httpStatus, logLevel) | ||
) : GalaxyhubException(message, httpStatus) |
4 changes: 1 addition & 3 deletions
4
src/main/kotlin/kr/galaxyhub/sc/common/exception/NotFoundException.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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
package kr.galaxyhub.sc.common.exception | ||
|
||
import kr.galaxyhub.sc.common.support.LogLevel | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.http.HttpStatusCode | ||
|
||
class NotFoundException( | ||
message: String, | ||
httpStatus: HttpStatusCode = HttpStatus.NOT_FOUND, | ||
logLevel: LogLevel = LogLevel.DEBUG, | ||
) : GalaxyhubException(message, httpStatus, logLevel) | ||
) : GalaxyhubException(message, httpStatus) |
4 changes: 1 addition & 3 deletions
4
src/main/kotlin/kr/galaxyhub/sc/common/exception/UnauthorizedException.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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
package kr.galaxyhub.sc.common.exception | ||
|
||
import kr.galaxyhub.sc.common.support.LogLevel | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.http.HttpStatusCode | ||
|
||
class UnauthorizedException( | ||
message: String, | ||
httpStatus: HttpStatusCode = HttpStatus.UNAUTHORIZED, | ||
logLevel: LogLevel = LogLevel.INFO, | ||
) : GalaxyhubException(message, httpStatus, logLevel) | ||
) : GalaxyhubException(message, httpStatus) |
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
src/main/kotlin/kr/galaxyhub/sc/crawler/application/CrawlerLogAop.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,19 @@ | ||
package kr.galaxyhub.sc.crawler.application | ||
|
||
import io.github.oshai.kotlinlogging.KotlinLogging | ||
import org.aspectj.lang.JoinPoint | ||
import org.aspectj.lang.annotation.AfterThrowing | ||
import org.aspectj.lang.annotation.Aspect | ||
import org.springframework.stereotype.Component | ||
|
||
private val log = KotlinLogging.logger {} | ||
|
||
@Component | ||
@Aspect | ||
class CrawlerLogAop { | ||
|
||
@AfterThrowing(pointcut = "this(Crawler) && execution(* crawling(String))", throwing = "ex") | ||
fun loggingException(joinPoint: JoinPoint, ex: Exception) { | ||
log.warn { "크롤링 중 예외가 발생했습니다. message: ${ex.message} class: ${joinPoint.target}, url: ${joinPoint.args[0]}" } | ||
} | ||
} |
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