gruntjs / grunt-cli

Grunt's command line interface.
http://gruntjs.com/
MIT License
706 stars 248 forks source link

Fatal error: Helpful details can lead debuggers astray #94

Closed JKVeganAbroad closed 8 years ago

JKVeganAbroad commented 8 years ago

I noticed in grunt-docs Issue # 121 that the suggested solution had led this developer astray in trying to resolve the issue. Apparently there are multiple Stack Overflow questions where other developers have similarly "gotten stuck" (here, here, here) and then Google found some more.

I've submitted a pull request just to remove the following:

If you're seeing this message, either a Gruntfile wasn't found or grunt hasn't been installed locally to your project. For more information about installing and configuring grunt, please see the Getting Started guide:

If the user indeed hasn't created a Gruntfile.js file (or has misnamed it), then grunt itself will detect this, and provide error code 2. So fortunately, this isn't an issue grunt-cli needs to worry about.

Do others think my pull request will assist with debugging? Or should we change the error message to be more specific?

shama commented 8 years ago

Fixed by https://github.com/gruntjs/grunt-cli/commit/9ea84be2b094f61b856eb44e9fea1cba3c242537

Nice research! We certainly can improve the error messages a bit more. Also the error codes it exits with is currently not correct: https://github.com/gruntjs/grunt/issues/1459

We could fix some of these things in the meantime or fix this while implementing: https://github.com/gruntjs/rfcs/pull/2

JKVeganAbroad commented 8 years ago

Alrighty! I'll close this issue now :)

shama commented 8 years ago

:+1: