How to use the CancellationError function from bluebird
Find comprehensive JavaScript bluebird.CancellationError code examples handpicked from public code repositorys.
32 33 34 35 36 37 38 39 40 41
}) .on('error', function(err) { reject(err); }) .on('abort', function() { reject(new Promise.CancellationError()); }) .on('timeout', function() { reject(new Promise.TimeoutError()); });
5
56
1
21 22 23 24 25 26 27 28 29 30
req.on('error', function (err) { reject(err); }); req.on('abort', function () { reject(new Promise.CancellationError("Request aborted")); }); }) .cancellable()
7
16
9
GitHub: TruenoDB/trueno
3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390
},{}],15:[function(_dereq_,module,exports){ "use strict"; module.exports = function(Promise, tryConvertToPromise) { var util = _dereq_("./util"); var CancellationError = Promise.CancellationError; var errorObj = util.errorObj; function PassThroughHandlerContext(promise, type, handler) { this.promise = promise;
3
16
0
357 358 359 360 361 362 363 364 365 366
return Promise.all([ fs.statAsync(path), this._refreshing ]).spread(function (stat) { if (stat.mtime <= file.mtime) throw new Promise.CancellationError() file.mtime = stat.mtime return self._preprocess(file) })
0
0
0
bluebird.reject is the most popular function in bluebird (2988 examples)