title: Angular error handling on a promise
body: <p>I'm new to Angular and the general idea of promises so please bear with me on this one.</p>
  
  <p>I have this general setup for a promise below:</p>
  
  <pre><code>ApiService.getDataUriForUrl(imageUrl).then(function(url){
      requests--;
  }, function(error){
      console.log('oh no!');
  });
  </code></pre>
  
  <p>I wrote this thinking that the <code>function(error)</code> would catch exceptions thrown on the <code>getDataUriForUrl()</code> call, but I now am led to believe it is for dealing with errors in the <code>then(...</code> area. </p>
  
  <p>How should I be formatting this to intercept errors as I desire? (catching exceptions thrown in the getDataUriForUrl() call).</p>