From 9396cb4e3382f4f88e4e22909d3a0b74a796a761 Mon Sep 17 00:00:00 2001 From: Kyle Robinson Young Date: Mon, 25 Feb 2013 10:53:33 -0800 Subject: [PATCH] Check in case returned error is a string. Ref GH-52. --- tasks/watch.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/watch.js b/tasks/watch.js index 25e6e4a..fb909bb 100644 --- a/tasks/watch.js +++ b/tasks/watch.js @@ -97,7 +97,10 @@ module.exports = function(grunt) { }); // On watcher error - this.on('error', function(err) { grunt.log.error(err); }); + this.on('error', function(err) { + if (typeof err === 'string') { err = new Error(err); } + grunt.log.error(err.message); + }); }); });