More specific log message for missing HTTP API
This commit is contained in:
parent
6e830bee34
commit
b72864ca75
18
lib/cylon.js
18
lib/cylon.js
|
@ -89,11 +89,21 @@ Cylon.api = function api(Server, opts) {
|
||||||
Server = require(req);
|
Server = require(req);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code === "MODULE_NOT_FOUND") {
|
if (e.code === "MODULE_NOT_FOUND") {
|
||||||
Logger.error("Cannot find the " + req + " API module.");
|
var messages;
|
||||||
Logger.error(
|
|
||||||
"You may be able to install it: `npm install " + req + "`"
|
|
||||||
);
|
|
||||||
|
|
||||||
|
if (req === "cylon-api-http") {
|
||||||
|
messages = [
|
||||||
|
"The HTTP API is no longer included in Cylon by default.",
|
||||||
|
"To use it, install the plugin module: `npm install cylon-api-http`"
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
messages = [
|
||||||
|
"Cannot find the " + req + " API module.",
|
||||||
|
"You may be able to install it: `npm install " + req + "`"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
_.each(messages, function(str) { Logger.error(str); });
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
|
|
Loading…
Reference in New Issue