@@ -43,27 +43,28 @@ module.exports = function(input, inputMap) {
43
43
try {
44
44
map = JSON . parse ( mapStr )
45
45
} catch ( e ) {
46
- emitWarning ( "Cannot parse inline SourceMap '" + mapBase64 . substr ( 0 , 50 ) + "': " + e ) ;
46
+ emitWarning ( new Error ( "Cannot parse inline SourceMap '"
47
+ + mapBase64 . substr ( 0 , 50 ) + "': " + e ) ) ;
47
48
return untouched ( ) ;
48
49
}
49
50
processMap ( map , this . context , callback ) ;
50
51
} else {
51
52
resolveAbsolutePath ( this . context , url , function ( err , absoluteFilepath ) {
52
53
if ( err ) {
53
- emitWarning ( "Cannot find SourceMap '" + url + "': " + err ) ;
54
+ emitWarning ( new Error ( "Cannot find SourceMap '" + url + "': " + err ) ) ;
54
55
return untouched ( ) ;
55
56
}
56
57
fs . readFile ( absoluteFilepath , "utf-8" , function ( err , content ) {
57
58
if ( err ) {
58
- emitWarning ( "Cannot open SourceMap '" + absoluteFilepath + "': " + err ) ;
59
+ emitWarning ( new Error ( "Cannot open SourceMap '" + absoluteFilepath + "': " + err ) ) ;
59
60
return untouched ( ) ;
60
61
}
61
62
addDependency ( absoluteFilepath ) ;
62
63
var map ;
63
64
try {
64
65
map = JSON . parse ( content ) ;
65
66
} catch ( e ) {
66
- emitWarning ( "Cannot parse SourceMap '" + url + "': " + e ) ;
67
+ emitWarning ( new Error ( "Cannot parse SourceMap '" + url + "': " + e ) ) ;
67
68
return untouched ( ) ;
68
69
}
69
70
processMap ( map , path . dirname ( absoluteFilepath ) , callback ) ;
@@ -101,7 +102,7 @@ module.exports = function(input, inputMap) {
101
102
const sourcesPromises = sources . map ( ( source , sourceIndex ) => new Promise ( ( resolveSource ) => {
102
103
resolveAbsolutePath ( context , source , function ( err , absoluteFilepath ) {
103
104
if ( err ) {
104
- emitWarning ( "Cannot find source file '" + source + "': " + err ) ;
105
+ emitWarning ( new Error ( "Cannot find source file '" + source + "': " + err ) ) ;
105
106
return resolveSource ( {
106
107
source : source ,
107
108
content : sourcesContent [ sourceIndex ] != null ? sourcesContent [ sourceIndex ] : null
@@ -115,7 +116,7 @@ module.exports = function(input, inputMap) {
115
116
}
116
117
fs . readFile ( absoluteFilepath , "utf-8" , function ( err , content ) {
117
118
if ( err ) {
118
- emitWarning ( "Cannot open source file '" + absoluteFilepath + "': " + err ) ;
119
+ emitWarning ( new Error ( "Cannot open source file '" + absoluteFilepath + "': " + err ) ) ;
119
120
return resolveSource ( {
120
121
source : absoluteFilepath ,
121
122
content : null
0 commit comments