-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log stacktrace when a task fails #591
Comments
So |
Most grunt users aren't task authors, and they don't want or need to see stack traces. They just want pretty grunt errors. I'd recommend that you I will add a note in the plugin authoring guide about this. |
I really feel like there should be a configuration option on the GruntFile which enables developers to turn this on and off without having to resort to the cli. In our office we share Grunt packages across many developers and I feel like it would be unreasonable to ask them to alias the grunt cmd to get proper stack traces. |
@damassi You could add |
Awesome, that worked perfect. Thank you! |
+1 for making this option on by default |
+1 for |
+1 for turning this on by default. |
👍 for default stack. |
+1 for default or remove it completely. |
+1 on default |
+1 This option by default. If an author is writing a task for non-authors then it should be up to them to make the call to suppress errors or not. |
I can't think of any reason why this wouldn't be the default. No errors means no stack trace, even with it turned on, same as pretty. Errors give us a place to look, to fix the problem. Even those who are not task authors can report the error to the authors. |
+1 |
-1 for on by default. I don't want a stack trace dumped for every legitimate error that a plugin throws at me. |
-1 for on by default, but maybe offer info in the error display like (--stack for details) |
I'm confused about the contention here. I don't see any reason you'd want to hide the stack trace when you get an error and grunt exits with 1. Its completely worthless when that happens. |
+1 for default |
If the developers don't want to make it a default, a middle ground solution could be to raise awareness of the
Alternatively, enable the stack option when |
I think the issue is that some errors do not have any meaning without stacks. In such cases, it would be better for task author to enforce stacks output for some fatal errors. I'd propose following addition: // Last argument when set to `true` enforces output of the error with stack trace
grunt.log.error(new Error('Hey, too bad :('), true) |
Grunt 0.4 is terrible about debugging tasks, since it only logs exception messages and throws away the stack. Adding
--verbose --debug
doesn't make a difference. Grunt should log the exception stacktrace by default, since an exception always is a fatal error, there's no point in hiding that behind options.See also #578 and my comment there.
The text was updated successfully, but these errors were encountered: