Kotlin-Coroutines-Android-Examples
Kotlin-Coroutines-Android-Examples copied to clipboard
How to handle no internet connection
Thanks for this great project
I tried your code, but its show whole IP address of API, but I want to show only "no internet connection when there is no internet connection"
In this project, We are simply sharing the exception message or a generic message "Something Went Wrong" We can handle no internet available scenario based on our application architecture to check the internet before making call.
https://github.com/MindorksOpenSource/Kotlin-Coroutines-Android-Examples/blob/adc18ea7213887e0da6924bd6efa0bf0158e60de/app/src/main/java/com/mindorks/example/coroutines/learn/retrofit/single/SingleNetworkCallViewModel.kt#L31