Skip to content

Commit

Permalink
Add full path to errors with stack traces
Browse files Browse the repository at this point in the history
Before:
```
The Broccoli Plugin: [object Object] failed with:
Error: Error parsing code while looking for "npm:" imports: TypeError: Cannot read property 'elements' of undefined
    at findAMDImports (/Users/bryan/dev/betterup-app/frontend/node_modules/ember-browserify/lib/stubs.js:114:6)
```

After:
```
The Broccoli Plugin: [object Object] failed with:
Error: Error parsing code while looking for "npm:" imports in file: /Users/bryan/dev/betterup-app/frontend/tmp/stub_generator-input_base_path-RWdqCdT1.tmp/frontend/tests/factories/assessment.js
TypeError: Cannot read property 'elements' of undefined
    at findAMDImports (/Users/bryan/dev/betterup-app/frontend/node_modules/ember-browserify/lib/stubs.js:114:6)
```
  • Loading branch information
bryanhickerson committed Mar 14, 2018
1 parent f249f8b commit 57d2620
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/stubs.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function importsFor(src, fullPath) {
try {
return parseModule(src);
} catch (error) {
throw new Error('Error parsing code while looking for "npm:" imports: ' + error.stack || error + ' in file: ' + fullPath);
throw new Error('Error parsing code while looking for "npm:" imports in file: ' + fullPath + ' ' + error.stack || error);
}
}

Expand Down

0 comments on commit 57d2620

Please sign in to comment.