Q.js手册

结尾

When you get to the end of a chain of promises, you should either return the last promise or end the chain. Since handlers catch errors, it’s an unfortunate pattern that the exceptions can go unobserved.

或者返回

return foo()
  .then(function () {
    return "bar";
  });

或者结束它.

foo()
  .then(function () {
    return "bar";
  })
 .done();

Ending a promise chain makes sure that, if an error doesn’t get handled before the end, it will get rethrown and reported.

This is a stopgap. We are exploring ways to make unhandled errors visible without any explicit handling.