[Grok-dev] better error messages

Martijn Faassen faassen at startifact.com
Fri May 9 09:02:02 EDT 2008


Hi there,

Brandon Craig Rhodes wrote:
[snip]
> This brings up an issue I'd wanted to suggest: I think it's
> frightening for normal developers that simple things like missing
> templates produce Grok tracebacks.  I think a special grok_developer
> flag should be necessary to see the traceback from errors that our
> code detects and understands.  Why do I feel this way?
> 
>   (1) Visually, I think that a traceback from inside of Grok's code
>       makes it look like Grok, itself, has failed and needs to be
>       debugged.
> 
>   (2) Therefore, if we detect an error and can simply print out "you
>       have a Foo view in app.py but no foo.pt template", then we
>       should; a traceback into Grok's correctly-working (!) code that
>       it executed to produce the error is irrelevant.  Heck, even if
>       it *is* a bug in Grok that caused the message, the traceback is
>       probably irrelevant, since the bit grokking logic that went
>       wrong is probably long done by then! :-)
> 
>   (3) The only real reason, in my opinion, to have an error produce a
>       traceback is if the traceback *includes the user's code*.  If
>       their code, that called something that failed, is not going to
>       be anywhere in the traceback, we ought to suppress it by default.
> 
> Irrelevant tracebacks make us too much like Java products I've seen. :-)

I'm not against this (as long as it can all be turned off. Trying to 
handle errors always risks shielding you from real errors).

I think this should be done incrementally. I suspect one low-handing 
fruit is the way the configuration machinery's error handling now wraps 
real errors (like import errors or syntax errors, even). Catching this 
and pulling out the actual error should make the responses a bit cleaner 
again.

Anyway, I think proposed patches are welcome, with plenty of tests. :)

Regards,

Martijn



More information about the Grok-dev mailing list