title: How to retry API call in retrofit interface with coroutines enabled
body: <p>I have a use case whenever generic error like internet lost or unknown error occurs in API call need to show error UI with retry button. when user press retry previously failed API should call and resume the user flow.</p>
  <p>API interface before migrating coroutines method:</p>
  <pre><code> interface TodoService {
      @POST(&quot;todo/create&quot;)
     fun createTodo(@Body request: TodoRequest): Call&lt;TodoResponse&gt;
  }
  </code></pre>
  <p>API client:</p>
  <pre><code>    fun &lt;T&gt; fetch(call: Call&lt;T&gt;, completion: (result: NetworkBoundResource&lt;T&gt;) -&gt; Unit) {
     
      call.enqueue(object : Callback&lt;T&gt; {
          override fun onFailure(call: Call&lt;T&gt;, t: Throwable) {
              // I have the mechanism save call object and completion and show error UI
              // when user press retry fetch(call.clone(), completion
          }
  
          override fun onResponse(call: Call&lt;T&gt;, response: Response&lt;T&gt;) {
  
          }
      })
  }
  </code></pre>
  <p>This was not a problem before migrating retrofit interface to coroutines suspend methods. Because I can just clone the retrofit call object <code>(call.clone())</code> and retry the API call as explained in the code comments.</p>
  <p>API interface after migrating coroutines method:</p>
  <pre><code>interface TodoService {
     @POST(&quot;todo/create&quot;)
     suspend fun createTodo(@Body request: TodoRequest): TodoResponse
  }
  </code></pre>
  <p><strong>Now how can i achieve same feature without Call object?</strong></p>