Can promise Halt the Function Chain?

  node.js, question

I use q.js to handle the problem of asynchronous calls. Perhaps my understanding of promise is not in place, and I have always found it awkward to deal with the situation of reject (). First, let’s look at my handling method. If there is anything wrong with it, please point it out.
The code is as follows:

var Q = require('q');
 
 Q.fcall(function(){
 return 2;
 }).then(function(v){//f1
 var deferred = Q.defer();
 if(v == 1)
 deferred.resolve("resolve");
 else
 deferred.reject("reject");
 return deferred.promise;
 }).then(function(){//f2
 console.log("f2 resolve");
 },function(){
 console.log("f2 reject");
 //If the last function was reject, since the function has reported an error, I do not want to execute f3 function again. How can I write here to prevent f3 from executing?
 //Normally, the f3 function will be executed
 }).then(function(){//f3
 console.log('end');
 });

The execution result of the FIA Formula 1 World Championship function returns the status of reject, reaching the fail function inside of f2. Can you stop the f3 function from being executed again here?
If my friends have a good way to deal with reject, they can show the code for me to learn. Thank you first!

Add a sentence to the second function of the second thenthrow 0Try it. Of course, you can decide what to throw yourself.

function(){
 console.log("f2 reject");
 return Q.reject();  //Try adding this sentence
 // throw 0;  //or this sentence
 
 //If the last function was reject, since the function has reported an error, I do not want to execute f3 function again. How can I write here to prevent f3 from executing?
 //Normally, the f3 function will be executed
 bracket

In general, a reject check will be added at the end, such as

q.then(fSuccess).then(fSuccess2).fail(fFail);

If the first fails, the second will be skipped.