Print backtraces by default #31

Closed
richmeyers opened this Issue May 18, 2011 · 4 comments

4 participants

@richmeyers

Currently when an exception is propagated out of a rake task rake prints the exception message but no backtrace. Usually "normal" / expected errors are caught by the task (or application, or whatever) and are presented to user in a more friendly fashion than an uncaught exception. Which means the exceptions that escape rake tasks are usually unexpected, and frequently don't have messages that are terribly useful.

In most if not all cases the user has to run rake with --trace again to get the backtrace so that they can troubleshoot the problem. In cases where the user does not need to run rake with --trace typically they dealt with the same exception just before and know where it is coming from, but even so printing a backtrace would not hurt them.

Thus I suggest making backtrace printing the default behavior.

I'm not sure if --quiet should stop backtrace printing by default. I am leaning toward still printing full backtraces by default even with --quiet.

Note that --trace does more than backtrace printing, it also traces execution. --trace would therefore remain but would only turn on execution tracing.

I cannot really imagine why backtrace printing would be undesired, but a compromise solution could be not printing backtraces by default with --quiet such that --quiet --trace would print backtraces.

@isaacsanders

It is kinda verbose. Some people have other output that would be harder to find if we had a backtrace to hunt through, too.

@quix

How about #64?

@jimweirich
Owner

Implemented in #64.

@jimweirich jimweirich closed this Aug 5, 2011
@richmeyers

I installed 0.9.3 beta 1 and then master to try this behavior. In either case no backtrace was printed.

I'm guessing it might be because the entire backtrace was "suppressed". Looking at it there are no "user" lines in it at all - https://gist.github.com/da5d4f5e534a4baeffaa. At the same time all rake tasks in the task listing are the ones that I defined (these apparently have no bodies, just dependencies on other tasks) or requested to define (the actual definition, it seems, happens in one of the gems in such cases).

I'm not sure you can assume that if a stack frame is credited to a library it is automatically not "interesting" to the user.

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