Log errors in preload script instead of rethrowing

At some point, unhandled errors in preload scripts stopped being logged
to console, meaning that preload scripts were very difficult to debug.
Instead, print the error to console (which is what we wanted to have
happen anyways)
This commit is contained in:
Paul Betts 2015-05-01 16:10:45 -07:00
parent 4608f5e9cd
commit e2ec50173f

View file

@ -103,5 +103,8 @@ if preloadScript
try
require preloadScript
catch error
throw error unless error.code is 'MODULE_NOT_FOUND'
console.error "Unable to load preload script #{preloadScript}"
if error.code is 'MODULE_NOT_FOUND'
console.error "Unable to load preload script #{preloadScript}"
else
console.error(error)
console.error(error.stack)