File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,10 @@ module.exports = function(options) {
36
36
37
37
this . push ( file ) ;
38
38
} catch ( error ) {
39
- this . emit ( 'error' , new PluginError ( PLUGIN_NAME , error ) ) ;
39
+ this . emit (
40
+ 'error' ,
41
+ new PluginError ( PLUGIN_NAME , error , { fileName : file . path } )
42
+ ) ;
40
43
}
41
44
42
45
callback ( ) ;
@@ -79,7 +82,10 @@ module.exports.check = function(options) {
79
82
80
83
this . push ( file ) ;
81
84
} catch ( error ) {
82
- this . emit ( 'error' , new PluginError ( PLUGIN_NAME , error ) ) ;
85
+ this . emit (
86
+ 'error' ,
87
+ new PluginError ( PLUGIN_NAME , error , { fileName : file . path } )
88
+ ) ;
83
89
}
84
90
85
91
callback ( ) ;
Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ describe('gulp-prettier', () => {
114
114
assert . ok ( err instanceof PluginError ) ;
115
115
assert . strictEqual ( err . plugin , pkg . name ) ;
116
116
assert . strictEqual ( err . name , 'SyntaxError' ) ;
117
+ assert . strictEqual (
118
+ err . fileName ,
119
+ path . join ( process . cwd ( ) , 'src' , 'error.js' )
120
+ ) ;
117
121
done ( ) ;
118
122
} ) ;
119
123
You can’t perform that action at this time.
0 commit comments