Skip to content

Commit 181453f

Browse files
committed
[Fix/#145] clearDirectory 에러처리 수정
- as-is : finally 블록에서 에러를 throw로 전파해 위험 - to-be : throw 제거, runCatching으로 에러 시 로그만 찍음
1 parent ae9c4de commit 181453f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/src/main/java/com/poti/android/domain/usecase/image/UploadImagesUseCaseV2.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import com.poti.android.core.common.constant.ImageConstants.IMAGE_EXTENSION
44
import com.poti.android.domain.model.image.PresignedUploadInfo
55
import com.poti.android.domain.repository.FileUploadRepository
66
import com.poti.android.domain.repository.ImageRepository
7+
import timber.log.Timber
78
import java.io.File
89
import javax.inject.Inject
910
import kotlin.coroutines.cancellation.CancellationException
@@ -59,6 +60,10 @@ class UploadImagesUseCaseV2 @Inject constructor(
5960
}
6061
}
6162

62-
private fun clearDirectory() = fileUploadRepository
63-
.clearDirectory().getOrThrow()
63+
private fun clearDirectory() = runCatching {
64+
fileUploadRepository.clearDirectory()
65+
.onFailure {
66+
Timber.e(it, "fail on clearDirectory")
67+
}
68+
}
6469
}

0 commit comments

Comments
 (0)