-1 returned for status code when using await with coroutines
See original GitHub issueBug Report
Description
When my request is unsuccessful, and is awaited using the coroutine methods, the status code is being returned as -1
request.responseString().second.statusCode // RETURNS 401
request.awaitStringResponseResult().second.statusCode // RETURNS -1
Expected behavior
The correct status code should be returned when using coroutines. -1 is not a valid status code.
Development Machine
Complete the following information if applicable
- OS: Windows 10
- IDE: IntelliJ
- Fuel version: 2.0.1
- Kotlin version: 1.3.21
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.1.1'
implementation 'com.github.kittinunf.fuel:fuel:2.0.1'
implementation 'com.github.kittinunf.fuel:fuel-coroutines:2.0.1'
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Kotlin Coroutine returning after response.await()
I am trying to make an android app connecting to api, and for that I am using Kotlin Coroutines and Retrofit. I was...
Read more >Kotlin Coroutines by Tutorials, Chapter 5: Async/Await
First, you've removed the callback from the parameters, and, secondly, you've returned a GlobalScope. async() block as the return value for the function....
Read more >Async code using Kotlin Coroutines | by Fabio Collini
This syntax is valid but we are creating a new coroutines using async and immediately waiting for the result using await . There...
Read more >Coroutines and Tasks — Python 3.11.1 documentation
Wrap the coro coroutine into a Task and schedule its execution. Return the Task object. If name is not None , it is...
Read more >Async and Await - Kotlin Coroutines - YouTube
In this video you will learn what async and await can be used for in coroutines.⭐ Get certificates for your future job⭐ Save...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SleeplessByte
Thanks for your report!!! @thomhurst I will make sure that we have the next version sooner rather than rather.