Skip to content

Commit c9bc82c

Browse files
committed
[BOOK-252] fix: initialLoad를 coroutineScope로 변경하여 예외 전파 보장
1 parent 16237ed commit c9bc82c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import kotlinx.collections.immutable.persistentListOf
3535
import kotlinx.collections.immutable.toImmutableList
3636
import kotlinx.collections.immutable.toPersistentList
3737
import kotlinx.coroutines.async
38+
import kotlinx.coroutines.coroutineScope
3839
import kotlinx.coroutines.launch
3940
import java.time.LocalDateTime
4041

@@ -75,11 +76,11 @@ class BookDetailPresenter @AssistedInject constructor(
7576
var sideEffect by rememberRetained { mutableStateOf<BookDetailSideEffect?>(null) }
7677

7778
@Suppress("TooGenericExceptionCaught")
78-
fun initialLoad() {
79+
suspend fun initialLoad() {
7980
uiState = UiState.Loading
8081

8182
try {
82-
scope.launch {
83+
coroutineScope {
8384
val bookDetailDef = async { bookRepository.getBookDetail(screen.isbn13).getOrThrow() }
8485
val seedsDef = async { bookRepository.getSeedsStats(screen.userBookId).getOrThrow() }
8586
val readingRecordsDef = async {

0 commit comments

Comments
 (0)