From b4e2240edeb25f979d53cd05aa5f36c1f85b9e68 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Sat, 27 Aug 2011 13:21:03 -0400 Subject: [PATCH] fixes #1633: error output when using `coffee -e` --- lib/coffee-script/command.js | 2 +- src/command.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coffee-script/command.js b/lib/coffee-script/command.js index 750f6305..77c6c0cb 100644 --- a/lib/coffee-script/command.js +++ b/lib/coffee-script/command.js @@ -141,7 +141,7 @@ CoffeeScript.emit('failure', err, task); if (CoffeeScript.listeners('failure').length) return; if (o.watch) return printLine(err.message); - printWarn(err.stack); + printWarn(err instanceof Error && err.stack || ("ERROR: " + err)); return process.exit(1); } }; diff --git a/src/command.coffee b/src/command.coffee index 9433f3b3..3500fdcd 100644 --- a/src/command.coffee +++ b/src/command.coffee @@ -140,7 +140,7 @@ compileScript = (file, input, base) -> CoffeeScript.emit 'failure', err, task return if CoffeeScript.listeners('failure').length return printLine err.message if o.watch - printWarn err.stack + printWarn err instanceof Error and err.stack or "ERROR: #{err}" process.exit 1 # Attach the appropriate listeners to compile scripts incoming over **stdin**,