Skip to content

Commit 6d54dd7

Browse files
committed
refactor ( #20 ) : 비즈니스 로직에서 에러 처리 되어 있기 때문에 try-catch 삭제
1 parent 045cf40 commit 6d54dd7

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

  • casper-user/src/main/kotlin/hs/kr/entrydsm/user/infrastructure/grpc/server

casper-user/src/main/kotlin/hs/kr/entrydsm/user/infrastructure/grpc/server/UserGrpcService.kt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,8 @@ class UserGrpcService(
3030
* @throws StatusException UUID 형식이 잘못되었거나 서버 오류가 발생한 경우
3131
*/
3232
override suspend fun getUserInfoByUserId(request: UserServiceProto.GetUserInfoRequest): UserServiceProto.GetUserInfoResponse {
33-
34-
return try {
35-
val userId = UUID.fromString(request.userId)
36-
val userInfo = queryUserByUUIDUseCase.getUserById(userId)
37-
userGrpcMapper.toGetUserInfoResponse(userInfo)
38-
} catch (e: IllegalArgumentException) {
39-
throw StatusException(Status.INVALID_ARGUMENT.withDescription("Invalid UUID format"))
40-
} catch (e: Exception) {
41-
throw StatusException(Status.INTERNAL.withDescription("서버 오류"))
42-
}
33+
val userId = UUID.fromString(request.userId)
34+
val userInfo = queryUserByUUIDUseCase.getUserById(userId)
35+
return userGrpcMapper.toGetUserInfoResponse(userInfo)
4336
}
44-
4537
}

0 commit comments

Comments
 (0)