Skip to content

Commit

Permalink
Update HttpUrlFetcher.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
iNoles authored Jun 16, 2024
1 parent 052672d commit 2dd4238
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions fuel/src/wasmJsMain/kotlin/fuel/HttpUrlFetcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ internal class HttpUrlFetcher {
window.fetch(urlString, requestInit)
.then {
if (it.ok) {
continuation.resume(HttpResponse().apply {
statusCode = it.status
response = it
headers = it.headers.mapToFuel()
})
continuation.resume(
HttpResponse().apply {
statusCode = it.status
response = it
headers = it.headers.mapToFuel()
}
)
null
} else {
continuation.resumeWithException(Exception("Failed to fetch data: ${it.status}"))
Expand Down

0 comments on commit 2dd4238

Please sign in to comment.