adding Future helper catch method
authorLuc Yriarte <luc.yriarte@intel.com>
Fri, 24 May 2013 13:08:44 +0000 (15:08 +0200)
committerLuc Yriarte <luc.yriarte@intel.com>
Fri, 24 May 2013 13:08:44 +0000 (15:08 +0200)
cloudeebus/cloudeebus.js

index 94c0ca0..a288239 100644 (file)
@@ -305,6 +305,11 @@ cloudeebus.Future.prototype.then = function(acceptCB, rejectCB) {
 };
 
 
+cloudeebus.Future.prototype["catch"] = function(rejectCB) {
+       return this.then(undefined,rejectCB);
+};
+
+
 cloudeebus.Future.resolve = function(value) {
        var future = new cloudeebus.Future();
        future.resolver.resolve(value, true);