Skip to content

Commit ca9dc0b

Browse files
committed
Merge pull request styleguidist#142 from MoOx/patch-1
More accurate filename in case of error when parsing component
2 parents 5169d9a + ba7b92d commit ca9dc0b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

loaders/props.loader.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ module.exports = function (source) {
1414

1515
var jsonProps;
1616
try {
17+
const file = this.request.split('!').pop()
1718
var propsParser = config.propsParser || defaultPropsParser;
18-
var props = propsParser(this.request.split('!').pop(), source);
19+
var props = propsParser(file, source);
1920

2021
jsonProps = (isArray(props) ? props : [props]).map(function(doc) {
2122
if (doc.description) {
@@ -36,7 +37,7 @@ module.exports = function (source) {
3637
});
3738
}
3839
catch (e) {
39-
console.log('Error when parsing', path.basename(this.request));
40+
console.log('Error when parsing', path.relative(process.cwd(), file));
4041
console.log(e.toString());
4142
console.log();
4243
jsonProps = [];

0 commit comments

Comments
 (0)