title: Handling multiple catches in promise chain
body: <p>I am still fairly new to promises and am using bluebird currently, however I have a scenario where I am not quite sure how to best deal with it.</p>
  
  <p>So for example I have a promise chain within an express app like so:</p>
  
  <pre><code>repository.Query(getAccountByIdQuery)
          .catch(function(error){
              res.status(404).send({ error: "No account found with this Id" });
          })
          .then(convertDocumentToModel)
          .then(verifyOldPassword)
          .catch(function(error) {
              res.status(406).send({ OldPassword: error });
          })
          .then(changePassword)
          .then(function(){
              res.status(200).send();
          })
          .catch(function(error){
              console.log(error);
              res.status(500).send({ error: "Unable to change password" });
          });
  </code></pre>
  
  <p>So the behaviour I am after is:</p>
  
  <ul>
  <li>Goes to get account by Id</li>
  <li>If there is a rejection at this point, bomb out and return an error</li>
  <li>If there is no error convert the document returned to a model</li>
  <li>Verify the password with the database document</li>
  <li>If the passwords dont match then bomb out and return a different error</li>
  <li>If there is no error change the passwords</li>
  <li>Then return success</li>
  <li>If anything else went wrong, return a 500</li>
  </ul>
  
  <p>So currently catches do not seem to stop the chaining, and that makes sense, so I am wondering if there is a way for me to somehow force the chain to stop at a certain point based upon the errors, or if there is a better way to structure this to get some form of branching behaviour, as there is a case of <code>if X do Y else Z</code>.</p>
  
  <p>Any help would be great.</p>