code: function fin(promise, finalPromiseFactory) {
    return promise.then(function (res) {
      return finalPromiseFactory().then(function () {
        return res;
      });
    }, function (reason) {
      return finalPromiseFactory().then(function () {
        throw reason;
      });
    });
  }
docs: Promise finally util similar to Q.finally