chore(transpiler): show filepath when error happens

This commit is contained in:
Vojta Jina 2014-10-09 15:17:53 -07:00
parent 94e556465b
commit 85ee62cb0d
1 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ function gulpTraceur(options, resolveModuleName) {
}
try {
var originalFilePath = file.history[0];
var moduleName = resolveModuleName ? resolveModuleName(file.relative) : null;
var compiled = compiler.compile(options, {
inputPath: file.relative,
@ -33,6 +34,7 @@ function gulpTraceur(options, resolveModuleName) {
if (errors.join) {
throw new Error('gulp-traceur: '+errors.join('\n'));
} else {
console.error('Error when transpiling:\n ' + originalFilePath);
throw errors;
}
}