File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/main/kotlin/org/gitanimals/rank/controller Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import org.gitanimals.rank.controller.response.RankTotalCountResponse
88import org.gitanimals.rank.domain.RankQueryRepository
99import org.gitanimals.rank.domain.history.RankHistoryService
1010import org.gitanimals.rank.domain.response.RankResponse
11+ import org.slf4j.LoggerFactory
1112import org.springframework.http.ResponseEntity
1213import org.springframework.web.bind.annotation.GetMapping
1314import org.springframework.web.bind.annotation.PathVariable
@@ -21,6 +22,8 @@ class RankController(
2122 private val rankHistoryService : RankHistoryService ,
2223) {
2324
25+ private val logger = LoggerFactory .getLogger(this ::class .simpleName)
26+
2427 @GetMapping(" /ranks" )
2528 fun findAllRanks (
2629 @RequestParam(" rank" ) rank : Int ,
@@ -35,12 +38,12 @@ class RankController(
3538 ): ResponseEntity <out Any > {
3639 return runCatching {
3740 ResponseEntity .ok(getRankByUsernameFacade.invoke(username))
38- }.getOrElse {
41+ }.getOrElse { exception ->
42+ logger.info(exception.message, exception)
43+
3944 ResponseEntity
4045 .badRequest()
41- .body(
42- ErrorResponse (" Cannot find rank by username: \" $username \" " )
43- )
46+ .body(ErrorResponse (" Cannot find rank by username: \" $username \" " ))
4447 }
4548 }
4649
You can’t perform that action at this time.
0 commit comments