4
app.js
app.httpclient.on('response', result => { if (result.res.code < 0) { throw new Error('error'); } });
middleware/error-handler.js
try { yield next; } catch (err) { console.log(err) }
这里错误无法被捕获。进程反而会crash,抛出uncaughtException。