Skip to content

Commit

Permalink
Show other wrapper require errors than MODULE_NOT_FOUND on console
Browse files Browse the repository at this point in the history
  • Loading branch information
kennu committed Jul 26, 2016
1 parent e611726 commit f71abbc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/isomorphic/create-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ module.exports = (files, pagesReq) => {
// $FlowIssue - https://github.com/facebook/flow/issues/1975
wrappers[type] = require(`wrappers/${type}`)
} catch (e) {
// Ignore error.
// Ignore module not found errors; show others on console
if (e.code !== 'MODULE_NOT_FOUND'
&& (e.message && !e.message.match(/^Cannot find module/))
&& typeof console !== 'undefined') {
console.error('Error requiring wrapper', type, ':', e)
}
}
})

Expand Down

0 comments on commit f71abbc

Please sign in to comment.