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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -