【发布时间】:2014-09-03 00:55:47
【问题描述】:
什么是等价的 Bluebird promise err logging to this:
if (err) {
console.log(err);
res.send(err);
}
为此:
}).catch(Promise.OperationalError, function(e){
// handle error in Mongoose save findOne etc, res.send(...)
}).catch(function(e){
// handle other exceptions here, this is most likely
// a 500 error where the top one is a 4XX, but pay close
// attention to how you handle errors here
});
【问题讨论】:
标签: node.js error-handling mongoose promise bluebird