我在节点中使用new
--inspect
参数来使用Chrome Developer Tools
调试我的应用程序。我的保证链末尾有一个非常基本的catch
但是返回的错误并没有清楚地显示它们来自哪里。
我能看到错误源自哪个文件吗?
leagues(app).getLeagues(passData)
.then(teamsApi.getNorsemenTeams)
.then(filterBarGamesIndex)
.then(gamesApi.getNorseGames)
.then(gamesApi.getFilteredTeams)
.then(function (passData) {
res.render('games', {
title: 'Results',
passData: passData,
type: req.originalUrl.split('/')[2]
})
})
.catch(function(err) {
console.error(err); //Line 35
});
}
直接从控制台出错:
TypeError: Cannot read property 'Intermediate_Division_2' of undefined
at /var/www/beta.norsemanfc.co.uk/app/controllers/filterBar/fixturesIndex.js:27:62
at Array.filter (native)
at module.exports (/var/www/beta.norsemanfc.co.uk/app/controllers/filterBar/fixturesIndex.js:25:42)
at process._tickCallback (internal/process/next_tick.js:103:7)
答案 0 :(得分:3)
您可能希望转储有关该异常的更多信息,如
console.log(err.stack);