title: Javascript promise .catch not working
body: <p><strong>EDIT: SEE THE ANSWER BELOW</strong></p>
  
  <p>I have a function:</p>
  
  <pre><code>dataFactory.getCurrentStepId(wf.identifier, ctx.identifier)
     .then(function (data) {
        console.log('then');
        $timeout(function () {
        $("#app-node-" + data.identifier)
             .parent().parent().css("border", "5px solid green");
        });
      })
      .catch(function () {
        console.log('error');
        alert('Error!')
        });
  </code></pre>
  
  <p>The <code>getCurrentStepId</code> has an exception, and I see the error printed on the console for the AJAX request it sends, but my alert and console.log don't fire in the catch.</p>
  
  <p>Any ideas why?  Here is the stuff it's calling:</p>
  
  <pre><code>app.factory('dataFactory', function ($http, $q) {
      var _baseUrl = webServiceContext;
      var _doGet = function (endpoint) {
          var deferred = $q.defer();
          $http.get(_baseUrl + '/' + endpoint).then(function (response) {
              deferred.resolve(response.data);
          });
          return deferred.promise;
      };
  
      var getCurrentStepId = function (wid, cid) {
          return _doGet('wf/step/' + wid + '/' + cid);
      };
  })
  </code></pre>
  
  <p><strong>Here is the answer</strong></p>
  
  <p>@Blunderfest almost got it right:</p>
  
  <pre><code> $http.get(_baseUrl + '/' + endpoint).then(function (response) {
              deferred.resolve(response.data);
          }).catch(function(e){return deferred.reject(e);});
  </code></pre>