better error message for javascript parse errors #508

Merged
merged 1 commit into from Sep 20, 2012

3 participants

@drewfish
Yahoo Inc. member

No description provided.

@caridy

+1

@isao

nice

@FabianFrank FabianFrank commented on the diff Sep 15, 2012
lib/app/addons/rs/yui.server.js
@@ -626,7 +626,7 @@ YUI.add('addon-rs-yui', function(Y, NAME) {
libvm.runInNewContext(file, ctx, res.source.fs.fullPath);
} catch (e) {
yui = null;
- Y.log(e.message + '\n' + e.stack, 'error', NAME);
+ Y.log('failed to parse javascript file ' + res.source.fs.fullPath, 'error', NAME);

@drewfish doesn't the stack contain the parsing error and line number?

@drewfish
Yahoo Inc. member

The stack doesn't. I think the e.message contains the error, so yeah that should be in the output as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@drewfish drewfish merged commit a482e5e into yahoo:develop Sep 20, 2012

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment