Reputation: 254
I'm new to Promises and I'm not sure why I'm getting this error using bluebird:
.finally is not a function
my code structure looks like this:
const Promise = require('bluebird');
worker();
function worker(){
Promise.try(
do something ...
.then(
do something ...
.then(
do something ...
.then(
do something ...
)
.catch(log.error)
)
.catch(log.error)
)
.catch(log.error)
.finally(() => {
worker().delay(5000);
})
)
}
I appreciate any help on this matter.
Upvotes: 2
Views: 2959
Reputation: 254
I guess ".finally" wasn't supported in node version 8. updated node to version 10 and its now working.
Upvotes: 5