我正在使用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)