1

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 :-)

2 Answers2

2

Both Q and Bluebird do have a catch method:

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.

Community
  • 1
  • 1
Bergi
  • 630,263
  • 148
  • 957
  • 1,375
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