Skip to content


Better verbose logging for template errors #533

wants to merge 1 commit into from

2 participants


I was getting a template error that just said <WARN> An error occurred while processing a template (Cannot call method 'indexOf' of undefined). Use --force to continue. </WARN> Which wasn't very helpful, (which template?). So I added a stack trace to the warning when running with --verbose so that I could find some info about the source of the issue.

@stuartf stuartf referenced this pull request in asciidisco/grunt-imagine

Error processing a template #16

grunt member

Could you open this pull request against the devel branch? That is where the latest dev is happening. Thanks!

@shama shama closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 16, 2012
  1. @stuartf
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/grunt/template.js
1 lib/grunt/template.js
@@ -73,6 +73,7 @@ template.process = function(template, data, mode) {
last = template;
} catch (e) {
+ grunt.verbose.writeln(e.stack);
grunt.warn('An error occurred while processing a template (' + e.message + ').');
// Normalize linefeeds and return.
Something went wrong with that request. Please try again.