File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ ChildPool.prototype.retain = function(processFile) {
64
64
} )
65
65
. catch ( err => {
66
66
this . remove ( child ) ;
67
- throw new Error ( err ) ;
67
+ throw err ;
68
68
} ) ;
69
69
} ) ;
70
70
} ;
@@ -115,8 +115,8 @@ async function initChild(child, processFile) {
115
115
const onMessageHandler = msg => {
116
116
if ( msg . cmd === 'init-complete' ) {
117
117
resolve ( ) ;
118
- } else {
119
- reject ( msg . value ) ;
118
+ } else if ( msg . cmd === 'error' ) {
119
+ reject ( msg . error ) ;
120
120
}
121
121
child . off ( 'message' , onMessageHandler ) ;
122
122
} ;
Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ process.on('message', msg => {
50
50
processor = require ( msg . value ) ;
51
51
} catch ( err ) {
52
52
status = 'Errored' ;
53
+ err . message = `Error loading process file ${ msg . value } . ${ err . message } ` ;
53
54
return process . send ( {
54
55
cmd : 'error' ,
55
- value : `Error loading process file ${ msg . value } . ${ err . toString ( ) } `
56
+ error : err
56
57
} ) ;
57
58
}
58
59
You can’t perform that action at this time.
0 commit comments