Mongoose/JS - Jump out of code, skipping any then blocks
<p>If I have a call to check whether a particular ID exists - how do i exit the entire thing if an error is found right at the start.</p>

<p>I know I can do it with a if-else block, however is there a 'easier to read' 1 line way.</p>

<p>e.g.:</p>

<pre><code>Question.find({_id: req.headers['questionid']}, {question:1, tags:1},
                        function(err, foundQ) {


if(!err) {
      //skip everything below including the then
}

})
.then(function(foundQ){
    //Some more stuff here
})
</code></pre>

<p>Also, fyi - I'm using the Q framework in another section of code - so if there's an alternative method there someone could guide me to could also help.</p>