mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Print something better than [Object object]
If we ever load javascript (uniload load or package.js parse) outside of a buildmessage job and there's a syntax error, FancySyntaxError gets thrown instead of properly processed. Now, we shouldn't do that (we should only load JS inside a buildmessage job!) but our codebase isn't currently up to that standard, so at least ensure that there's some level of useful syntax error (albeit with an ugly internal stack trace attached) in this case.
This commit is contained in:
@@ -325,8 +325,8 @@ var exception = function (error) {
|
||||
// XXX this may be the wrong place to do this, but it makes syntax errors in
|
||||
// files loaded via unipackage.load have context.
|
||||
if (error instanceof files.FancySyntaxError) {
|
||||
error.message = "Syntax error: " + error.message + " at " +
|
||||
error.file + ":" + error.line + ":" + error.column;
|
||||
error = new Error("Syntax error: " + error.message + " at " +
|
||||
error.file + ":" + error.line + ":" + error.column);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user