a session expired - you can do <code>if (error.code === 401) return promptForAuth().then(retry)</code>. If you hit an API&#39;s throttling mechanism and it returned an error with a <code>&quot;timeout&quot;: 1000</code>, you could do a <code>setTimeout(retry, error.response.timeout)</code>.</p>
<hr>
<h3 id=loading-icons-and-error-messages><a href=#loading-icons-and-error-messages>Loading icons and error messages</a></h3>
<p>Here&#39;s an expanded version of the example above that implements a loading indica