feat: 🎸 优化 ResultDir 的报错信息, 更方便定位问题

This commit is contained in:
牧毅 2020-08-12 00:31:30 +08:00
parent c3d909aaf5
commit 965ef4a4ed

View File

@ -15,7 +15,7 @@ export default class ResultDir implements IResultDir {
if (this.dirs.findIndex(d => d.name === dir.name) < 0) { if (this.dirs.findIndex(d => d.name === dir.name) < 0) {
this.dirs.push(dir); this.dirs.push(dir);
} else { } else {
throw new CodeGeneratorError('Adding same directory to one directory'); throw new CodeGeneratorError(`Adding same directory to one directory: ${dir.name} -> ${this.name}`);
} }
} }
@ -25,7 +25,7 @@ export default class ResultDir implements IResultDir {
) { ) {
this.files.push(file); this.files.push(file);
} else { } else {
throw new CodeGeneratorError('Adding same file to one directory'); throw new CodeGeneratorError(`Adding same file to one directory: ${file.name} -> ${this.name}`);
} }
} }
} }