javascript - Bluebird Promise: error is not a function -
for reason can't find out, simple piece of code doesn't work.
new promise(function (resolve, reject) { resolve(); }).then(function() { console.log("then: ") }).error(function(err) { console.log("err: ", err) }) it gives me
uncaught typeerror: (intermediate value).then(...).error not function if replace error catch, runs fine. prefer not catch though.
what missing here?
making comment answer since turned out solution...
if .error() not exist, aren't using bluebird promise since .error() not part of promise standard may have built-in promise instead of bluebird promise.
check make sure bluebird included in project.
Comments
Post a Comment