diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -32,7 +32,9 @@ module.exports = function(opts) {
       compiled = handlebars.precompile(ast, compilerOptions).toString();
     }
     catch (err) {
-      this.emit('error', new gutil.PluginError(PLUGIN_NAME, err));
+      this.emit('error', new gutil.PluginError(PLUGIN_NAME, err, {
+        fileName: file.path
+      }));
       return callback();
     }
 
diff --git a/test/main.js b/test/main.js
index <HASH>..<HASH> 100644
--- a/test/main.js
+++ b/test/main.js
@@ -33,6 +33,7 @@ describe('gulp-handlebars', function() {
       var invalidTemplate = getFixture('Invalid.hbs');
 
       stream.on('error', function(err) {
+        err.fileName.should.equal('test/fixtures/Invalid.hbs'),
         err.should.be.an.instanceOf(Error);
         err.message.should.equal(getExpectedString('Error.txt'));
         done();
Include fileName in options to PluginError, closes #<I>