From bd99a75048418ab074916b38f7bd1a919c8fa455 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 15 Feb 2017 20:24:42 -0500 Subject: [PATCH] advice user when an unknown command is typed in the console --- lib/console.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/console.js b/lib/console.js index 6e57e0ff..8df883ac 100644 --- a/lib/console.js +++ b/lib/console.js @@ -36,7 +36,11 @@ Console.prototype.executeCmd = function(cmd, callback) { return callback(result); } catch(e) { - return callback(e.message.red); + if (e.message.indexOf('not defined') > 0) { + return callback(("error: " + e.message).red + ("\nType " + "help".bold + " to see the list of available commands").cyan); + } else { + return callback(e.message); + } } };