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**,