You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To be honest, I don't think this is something that needs to be fixed. Even if we add checks for the first parameter type, you can still fail even if you pass a function (on a wrong number of arguments, that it has). My $.02.
I think that the behavior (when params is wrong) should be the same for all(), loop(), serial() and race() methods. For me: The reject(fail) handler should be called as in Promise.all().
Reject handler invokation is expected.
Scenario:
Promise.loop(true, @() Promise(function (resolve, reject) { resolve(2) }))
.then(function(res) {
server.log("Resolve handler is called " + res);
}, function(res) {
server.log("Reject handler is called " + res);
})
Log:
2017-03-01 16:22:49+0000 [Agent] ERROR: attempt to call 'bool'
2017-03-01 16:22:49+0000 [Agent] ERROR: in unknown ...ricimp#promise.class.nut#3.0.0:191
The text was updated successfully, but these errors were encountered: