Closed joseph-jja closed 9 years ago
You want catch regular javascript error to terminal output?
I want those errors to break a build. Right now a build passes on mac and linux but may fail on windows, or fail sometimes. In some cases it may just be an error.
It seems that the template only catches require errors, but we have seen errors that are not from require. Like there is the require.onerror, there should be a window.onerror. Right now I have done something like the below to trap those other errors and get more information.
window.onerror = function(errorMsg, url, lineNumber) { var message = "ERROR in script: "; if ( errorMsg ) { message = message + errorMsg; if ( url ) { message = message + " in " + url; } if ( lineNumber ) { message = message + " at " + lineNumber; } throw message; } throw "Something bad happened, but I can't tell you what, cause I don't know :("; }