I want to do some POC to replace my Q library code with bluebird, after digging on the bluebird library I dont see (maybe i miss it) the fail method ,is it true? Does it have some similar logic (in BB) which I can consider to use,example will be helpful :-)
Asked
Active
Viewed 102 times
2 Answers
2
Both Q and Bluebird do have a catch
method:
- https://github.com/kriskowal/q/wiki/API-Reference#promisecatchonrejected
- http://bluebirdjs.com/docs/api/catch.html
which does about the same (being a shorthand for .then(null, …)
). Since catch
is a keyword and can cause syntax errors when used as a method name in pre-ES5 environments, both libraries do provide an alias. This alias is however different: fail
for Q, and caught
for Bluebird.
2
Note that bluebird has a Q adapter written by bluebird's author called bluebird-q.
Like Bergi said, the way forward is not to use fail
but to use .catch
like native promises and bluebird.

Benjamin Gruenbaum
- 270,886
- 87
- 504
- 504