chUsers(&quot;John&quot;)
  .then(getFirstId)
  .then(getUserProjects)
  .then(getProjectTitles)
  .then(alert)
  .catch(function(e) {
    console.log(e)
  })
</code></pre>
<p>Here&#39;s the previous example with error handling. The <code>searchUsers</code> function could fail if the network was offline, resulting in an error. In that case, none of the <code>.then</code> callbacks would be triggered, and the <code>.catch</code> callback would log the error to console.</p>
<p>If the request in <code>getUserP