diff --git a/lib/robot.js b/lib/robot.js index ab442a1..db6e14e 100644 --- a/lib/robot.js +++ b/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; + } } } };