title: Chaining promises with then and catch
body: <p>I'm using the bluebird Promise library. I'd like to chain promises and catch specific promises errors. Here's what I'm doing :</p>
  
  <pre><code>getSession(sessionId)
    .catch(function (err) {
      next(new Error('session not found'));
    })
    .then(function (session) {
      return getUser(session.user_id);
    })
    .catch(function (err) {
      next(new Error('user not found'));
    })
    .then(function (user) {
      req.user = user;
      next();
    });
  </code></pre>
  
  <p>But if an error is thrown by <code>getSession</code>, the two <code>catch</code> are called, as well as the second <code>then</code>. I'd like to stop the error propagation at the first <code>catch</code>, so that the second <code>catch</code> is only called when <code>getUser</code> throws, and the second <code>then</code> when <code>getUser</code> succeeds. What do?</p>