mirror of https://github.com/nodejs/node.git
Improve error message for requiring system modules.
parent
949f24305b
commit
7ddf1f569a
|
@ -179,7 +179,7 @@ node.Module.cache = {};
|
|||
if (fullPath) {
|
||||
retrieveFromCache(loadPromise, fullPath, parent);
|
||||
} else {
|
||||
loadPromise.emitError();
|
||||
loadPromise.emitError(new Error("Cannot find module '" + requestedPath + "'"));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -220,8 +220,8 @@ node.Module.prototype.loadObject = function (loadPromise) {
|
|||
node.dlopen(self.filename, self.target); // FIXME synchronus
|
||||
loadPromise.emitSuccess(self.target);
|
||||
} else {
|
||||
node.stdio.writeError("Error reading " + self.filename + "\n");
|
||||
loadPromise.emitError();
|
||||
node.error("Error reading " + self.filename + "\n");
|
||||
loadPromise.emitError(new Error("Error reading " + self.filename));
|
||||
node.exit(1);
|
||||
}
|
||||
});
|
||||
|
@ -232,7 +232,8 @@ node.Module.prototype.loadScript = function (loadPromise) {
|
|||
var catPromise = node.cat(self.filename);
|
||||
|
||||
catPromise.addErrback(function () {
|
||||
loadPromise.emitError(new Error("Error reading " + self.filename + "\n"));
|
||||
loadPromise.emitError(new Error("Error reading " + self.filename));
|
||||
node.exit(1);
|
||||
});
|
||||
|
||||
catPromise.addCallback(function (content) {
|
||||
|
|
Loading…
Reference in New Issue