From b72864ca755ab989fd4916128abd26e43ee52b98 Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Tue, 13 Jan 2015 10:13:16 -0800 Subject: [PATCH] More specific log message for missing HTTP API --- lib/cylon.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/cylon.js b/lib/cylon.js index dd352ef..2b3664c 100644 --- a/lib/cylon.js +++ b/lib/cylon.js @@ -89,11 +89,21 @@ Cylon.api = function api(Server, opts) { Server = require(req); } catch (e) { if (e.code === "MODULE_NOT_FOUND") { - Logger.error("Cannot find the " + req + " API module."); - Logger.error( - "You may be able to install it: `npm install " + req + "`" - ); + var messages; + 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; } else { throw e;