Let's say I'm building a registration flow, and I have something that looks like this:
Q.nfcall(validateNewRegCallback, email, password)
.fail(function(err){
console.log("bad email/pass: " + err);
return null;
})
.then(function(){
console.log("Validated!");
})
.done();
If my registration fails, I'd like to catch it, and die. Instead, I see both "bad email/pass" and "validated". Why is that, and how can I abort in the first failure call?