Kotlin Android Retrofit 2.6.0 with coroutines error handling
问题 I am using Retrofit 2.6.0 with coroutines for my web service call. I am getting the API response properly with all response codes (success & error cases). My Issue is when I disconnect the internet(Wifi/mobile data) in between an API call, from the code that I have written, the error is not getting caught properly. The errors most of the time are ConnectException and SocketException. I have tried to catch the error using interceptor and also in from the ViewModel where initiated my call as