Errors should not be swallowed #88

Merged
merged 1 commit into from Jun 19, 2011

Conversation

Projects
None yet
2 participants
Contributor

mcmire commented Jun 18, 2011

If a task for a guard throws an exception, the error is swallowed. This is fine, except that if you're developing a guard, all you get is an error message without an idea of where it occurred, which is not very helpful. This change prints the exception and its backtrace to the console before continuing.

One note about this is that I didn't know whether to print to stderr or use UI.error. I don't really know what the point of the UI module is -- since it resets colors, one would think that it prints colored messages also, but it doesn't do that, so I don't exactly see why it's being used. Feel free to change it to UI.error if that's what you really want, though.

Owner

rymai commented Jun 19, 2011

Hi,

if it's for development purpose, I think the UI#debug method is appropriate. You would then launch guard in debug mode with guard -d (I've just seen that this option is not documented in the README!) to see more info on the exception.

Contributor

mcmire commented Jun 19, 2011

Hmm. Yeah, UI.debug might make more sense. I could live with that.

@rymai rymai merged commit b41f31e into guard:master Jun 19, 2011

Owner

rymai commented Jun 19, 2011

Ok, I've merged the pull-request and finally used UI.error since I think it's always useful to see an Exception trace (not only during development). I've also added color (red) to the "ERROR:" flag when you use UI.error.

Thanks Elliot!

Unknown referenced this pull request Mar 1, 2012

Closed

:notification => false flag got ignored #248

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment