You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A colleague (@sp90) and I were adding error output from a terminal tool to a Grunt task, for Grunt to pass on to the user. The task is async and something along the lines of this:
grunt.registerMultiTask('terminal-task','Execute some terminal tool',function(){vardone=this.async();this.files.forEachAsync(function(file,idx,next){grunt.spawn({cmd: 'sometool',args: [file]},function(err,res){if(err!==null)returnnext(grunt.util.error(err));//Do something with resnext();});},done);
What we were surprised to see was that the error was not rendered by Grunt like grunt.log.error, which is what we expected, but rendered like grunt.log.warn. I tried to dig through the commit log, but didn't see anything about this being a conscious decision. The closest I found was #1163, but is in my opinion only tangentially related.
A colleague (@sp90) and I were adding error output from a terminal tool to a Grunt task, for Grunt to pass on to the user. The task is async and something along the lines of this:
What we were surprised to see was that the error was not rendered by Grunt like
grunt.log.error
, which is what we expected, but rendered likegrunt.log.warn
. I tried to dig through the commit log, but didn't see anything about this being a conscious decision. The closest I found was #1163, but is in my opinion only tangentially related.The relevant lines are
lib/util/task.js#L220-L222
->lib/grunt.js#L136-L138
->lib/grunt/fail.js#L28-L40
What I want to know is:
grunt.util.error
meant to be used like this?The text was updated successfully, but these errors were encountered: