Skip to content

Commit

Permalink
Merge pull request #631 from qdsfdhvh/bugfix/catch_execute_error
Browse files Browse the repository at this point in the history
catch execute error
  • Loading branch information
qdsfdhvh authored Oct 13, 2024
2 parents 6c16fab + af72d65 commit f0d77f8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
5 changes: 0 additions & 5 deletions app/web/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,3 @@ kotlin {
}
}
}

compose.experimental {
web.application {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,24 @@ private class RealImageLoader(

override suspend fun execute(request: ImageRequest): ImageResult {
return withContext(requestCoroutineContext) {
val chain = createInterceptorChain(
initialRequest = request,
initialOptions = getOptions(request),
config = config,
flowCollector = null,
runCatching {
val chain = createInterceptorChain(
initialRequest = request,
initialOptions = getOptions(request),
config = config,
flowCollector = null,
)
chain.proceed(request)
}.fold(
onSuccess = { it },
onFailure = {
if (it !is CancellationException) {
ImageResult.OfError(it)
} else {
throw it
}
},
)
chain.proceed(request)
}
}

Expand Down

0 comments on commit f0d77f8

Please sign in to comment.