Catch MODULE_NOT_FOUND errors, throw others
This commit is contained in:
parent
a92e51157f
commit
2563e62de4
12
lib/robot.js
12
lib/robot.js
|
@ -296,7 +296,11 @@ namespace("Cylon", function() {
|
|||
try {
|
||||
return this.adaptors[adaptorName] = require(moduleName);
|
||||
} catch (e) {
|
||||
this._missingModuleError(moduleName);
|
||||
if (e.code === "MODULE_NOT_FOUND") {
|
||||
this._missingModuleError(moduleName);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -354,7 +358,11 @@ namespace("Cylon", function() {
|
|||
try {
|
||||
return this.drivers[driverName] = require(moduleName);
|
||||
} catch (e) {
|
||||
this._missingModuleError(moduleName);
|
||||
if (e.code === "MODULE_NOT_FOUND") {
|
||||
this._missingModuleError(moduleName);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue