title: How to deal with exception with Deferred await error in Retrofit
body: <p>Our application has many network requests and we are using Coroutines with Retrofit like this: </p>
  
  <pre><code>suspend fun fetchAccountInfo() {
      val api = retrofit.create(MainActivityApi::class.java)
      val versionResponse = api.getVersionAsync().await()
      ...
  }
  </code></pre>
  
  <p>The problem is that when device is not connected to the internert, Retrofit will throw an exeption and the app will crash. I found <a href="https://github.com/JakeWharton/retrofit2-kotlin-coroutines-adapter/issues/3" rel="nofollow noreferrer">this link</a> that says, put await() into a try/catch like this:</p>
  
  <pre><code>suspend fun fetchAccountInfo() {
      val api = retrofit.create(MainActivityApi::class.java)
      try {
          val versionResponse = api.getVersionAsync().await()
      } catch(e: Exception) {
        //
      }
      ...
  }
  </code></pre>
  
  <p>But our app has many network requests and this solution is not proper for us. How can I prevent app crashing without putting all await() calls into a try/catch? </p>