Skip to content

Commit

Permalink
Handle error in child process spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
agsh committed Oct 31, 2018
1 parent 4005e08 commit 0aaf7d9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/rtsp-ffmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,13 @@ FFMpeg.prototype.start = function() {
setTimeout(FFMpeg.prototype.start.bind(this), 1000);
}
}.bind(this));
/*this.child.on('error', function(code) {
});*/
this.child.on('error', function(err) {
if (err.code === 'ENOENT') {
throw new Error('FFMpeg executable wasn\'t found. Install this package and check FFMpeg.cmd property');
} else {
throw err;
}
});
};

/**
Expand Down

0 comments on commit 0aaf7d9

Please sign in to comment.