W3cubDocs

/Bluebird

.throw

.throw(any reason) -> Promise
.thenThrow(any reason) -> Promise

Convenience method for:

.then(function() {
   throw reason;
});

Same limitations regarding to the binding time of reason to apply as with .return.

For compatibility with earlier ECMAScript version, an alias .thenThrow is provided for .throw.

© 2013–2018 Petka Antonov
Licensed under the MIT License.
http://bluebirdjs.com/docs/api/throw.html