----- Original Message ----- > From: "Matt Wagner" <[email protected]> > To: "Tomas Sedovic" <[email protected]> > Cc: [email protected] > Sent: Tuesday, December 11, 2012 4:55:10 PM > Subject: Re: [TIP] better_errors gem > > On Tue, Dec 11, 2012 at 01:59:56PM +0100, Tomas Sedovic wrote: > > On 12/10/2012 09:51 AM, Petr Blaho wrote: > > > Hi, > > > > > > in my feedreader I found a link to interesting gem - > > > better_errors (https://github.com/charliesome/better_errors). > > > > > > It makes rails (and not only rails) error page in development env > > > more > > > usable than before. It makes stacktrace clickable and for each > > > line in > > > stacktrace it displays source code around that line, list of > > > local and > > > instance variables with values and interactive REPL inside that > > > error > > > page. > > > > > > Hope it will make development of ruby/rails apps easier. > > > > Yeah I looked at that as well and I'm definitely in favour of > > giving > > this a try. > > > > What Sayeth The Community? > > It's really slick, and definitely _much_ better than what's included > by > default. > > It seems to be of limited use in Conductor, though, because we rescue > nearly all exceptions in ApplicationController and display a flash > message, so errors never bubble up high enough for better_errors to > handle them. > > I did comment them out in application_controller.rb to play around, > though, and I'm really liking it. I briefly thought that we could try > to > conditionalize these based on environment, but I think that's a bad > idea. (It seems that "only in development" or "only in production" > patches have _always_ blown up in my face.)
Hmm... Seems like that wouldn't have to be a separate patch, but maybe just an environment specific configuration value. To be fair, I haven't looked at the code at all, but seems like you could have a conditional based on a config value that's environment specific. Just a thought. > > I suppose that when debugging unexpected errors, it wouldn't be a bad > idea to comment the rescue lines out, and then drop 'better_errors' > and > 'binding_of_caller' (for the interactive REPL) in your Gemfile? :-\ > > -- Matt >
