Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

Changes to error handling output - where?

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


skip at mojam

Mar 8, 1999, 2:58 PM

Post #1 of 4 (386 views)
Permalink
Changes to error handling output - where?

I'm interested in making a change to the way errors are reported, but I'm
having a hard time nailing down where the changes need to be made.

(All statements reflect what I see in 1.9.0. I'm moving toward 1.10.2, but
am not quite there.)

I'd like BOBO_DEBUG_MODE/Z_DEBUG_MODE to accept three values: 0 & 1 would
have the same effect as they currently do. For any other value, I'd like
the system to treat the value as an email address & subject and mail the
traceback to the given address using the given subject. For example, a
value something like "skip [at] mojam:Bobo Traceback" would send a message to
skip [at] mojam with a subject of "Bobo Traceback" containing the traceback.

I've been able to figure out that BOBO_DEBUG_MODE and Z_DEBUG_MODE are
fiddled in ZPublisher.Publish.get_module_info, but I can't see where
bogosities in executed methods are caught and handled. Any pointers would
be greatly appreciated.

Thx,

Skip Montanaro | Mojam: "Uniting the World of Music" http://www.mojam.com/
skip [at] mojam | Musi-Cal: http://www.musi-cal.com/
518-372-5583


quinn at challenge

Mar 8, 1999, 5:21 PM

Post #2 of 4 (382 views)
Permalink
Re: Changes to error handling output - where? [In reply to]

> I'm interested in making a change to the way errors are reported, but I'm
> having a hard time nailing down where the changes need to be made.
>
> (All statements reflect what I see in 1.9.0. I'm moving toward 1.10.2, but
> am not quite there.)
>
> I'd like BOBO_DEBUG_MODE/Z_DEBUG_MODE to accept three values: 0 & 1 would
> have the same effect as they currently do. For any other value, I'd like
> the system to treat the value as an email address & subject and mail the
> traceback to the given address using the given subject. For example, a
> value something like "skip [at] mojam:Bobo Traceback" would send a message to
> skip [at] mojam with a subject of "Bobo Traceback" containing the traceback.
>
> I've been able to figure out that BOBO_DEBUG_MODE and Z_DEBUG_MODE are
> fiddled in ZPublisher.Publish.get_module_info, but I can't see where
> bogosities in executed methods are caught and handled. Any pointers would
> be greatly appreciated.

This is the same sort of thing I was wrestling with when I made my exception
handler comments, but I didn't receive any sort of feedback to that. My idea
was that you could have a BoboException or something which you subclass your
own exceptions off of. Then you put your error handling, webmaster-mailing,
web-page throwing stuff in your exception's __str__ method. AFAIK, the only
change required is adding an isinstance() line in Response.py. Of course,
this code could also snag sys.exc_info() and thus provide custom traceback
formatting and we could lose all the hard coded stuff in Response.py. Perhaps
BoboException could have a dtml attribute which is called if it's present for
the error page (since dtml works nicer when ZPublisher calls it instead of
python), and a handler attribute which is called if present (although its
results should be available to the dtml), as it would be a little more
intuitive to override BoboException.handler instead of BoboException.__str__.

Anyway, I think this would be a more general solution than adding more baggage
to Z_DEBUG_MODE (and what if you only want some errors mailed?), and could
provide a generalized and intuitive way of handling all errors gracefully
without doing lots of ad res error checking (that's what exceptions are for,
no?). And we could eliminate Z_DEBUG_MODE and __bobo_hide_tracebacks__ and
all those magic globals and have the same functionality by setting
BoboException attributes... all your exceptions inherit it and do what you
want, unless they explicitly override it.

Once again, what do people think? Should I submit to Collector? Forget about
it, it's already solved a different way? Mutilate ZPublisher and send
patches?


skip at mojam

Mar 9, 1999, 7:23 PM

Post #3 of 4 (379 views)
Permalink
Re: Changes to error handling output - where? [In reply to]

Quinn Dunkan writes:

[subclassing BoboException snipped]

Quinn> Anyway, I think this would be a more general solution than adding
Quinn> more baggage to Z_DEBUG_MODE (and what if you only want some
Quinn> errors mailed?), and could provide a generalized and intuitive
Quinn> way of handling all errors gracefully without doing lots of ad
Quinn> res error checking (that's what exceptions are for, no?).

Sounds like a much better suggestion than my (Z|BOBO)_DEBUG_MODE overload
idea. I say go ahead and make the required patch and post a diff. If we
rabble like it but the royalty doesn't we can always storm the castle to get
our way. ;-)

Skip Montanaro | Mojam: "Uniting the World of Music" http://www.mojam.com/
skip [at] mojam | Musi-Cal: http://www.musi-cal.com/
518-372-5583


Paul at digicool

Mar 10, 1999, 4:30 AM

Post #4 of 4 (378 views)
Permalink
RE: Changes to error handling output - where? [In reply to]

Skip writes:
> Sounds like a much better suggestion than my
> (Z|BOBO)_DEBUG_MODE overload
> idea. I say go ahead and make the required patch and post a
> diff. If we
> rabble like it but the royalty doesn't we can always storm
> the castle to get
> our way. ;-)

"History of the World Part I"
Courtier: "Sire, the peasants are revolting."
Mel Brooks: "You're not kidding, they stink on ice."

--Paul

_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
http://www.zope.org/mailman/listinfo/zope-dev

(For non-developer, user-level issues, use the companion list,
zope [at] zope, http://www.zope.org/mailman/listinfo/zope )

Zope dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.