Closed tunnckoCore closed 10 years ago
Another strange .. :D
// ...
.then(function(twentyTwo){
// Values get passed down the chain. Simple right?
// Now lets return a promise instead of a value
//testPromise(false).reject(new Error('some error'))
//throw new Error('some error')
console.log(twentyTwo)
return testPromise(twentyTwo+10)
})
.then(function(thiryThree) {
console.log(thiryThree)
return testPromise(thiryThree * 3)
})
.then(function(ninetyNine) {
console.log(ninetyNine)
return testPromise(ninetyNine);
}, console.error)
.done(function() {
console.log('all finally done')
})
If done is called stops at 33
, wtf? Without error.
22
- right place// ...
.then(function(twentyTwo){
// Values get passed down the chain. Simple right?
// Now lets return a promise instead of a value
//testPromise(false).reject(new Error('some error'))
throw new Error('some error')
console.log(twentyTwo)
return testPromise(twentyTwo+10)
})
.then(function(thiryThree) {
console.log(thiryThree)
return testPromise(thiryThree * 3)
})
.then(function(ninetyNine) {
console.log(ninetyNine)
return testPromise(ninetyNine);
}, console.error)
@Zolmeister okey, we have .finish
for "finally done" thing - my mistake, but why .done
mute errors instead of throw them
as docs says?
It does throw them, but only if they exist. In the examples you gave me all errors are handled before the .done()
call
@Zolmeister , looks its no matter - same thing without handling them and only throw new error/reject.
Thanks, fixed
@tunnckoCore: are you still using Promiz? .done
was removed with this rewrite.
@Zolmeister: any chance to get .done
back? I'm trying to port a project from Q to Promiz.
@dandv not atm. why you need .done
? it's not in the standard. try to not use non standard things.
@dandv Indeed, I would also advise using ES6 Promises
.catch(function(err) {
setTimeout(function() { throw err })
})
Is I miss something? Why when done is called, stop showing the errors?