Fail with a more informative error message if the browser executable path doesn't exist

This commit is contained in:
Marco Castelluccio 2015-04-17 16:12:13 +02:00
parent 63aaf1b969
commit fbae39983c

View File

@ -145,6 +145,10 @@ ChromiumBrowser.prototype.buildArguments = function (url) {
WebBrowser.create = function (desc) {
var name = desc.name;
// Throws an exception if the path doesn't exist.
fs.statSync(desc.path);
if (/firefox/i.test(name)) {
return new FirefoxBrowser(desc.name, desc.path);
}