RE: [Zope-dev] Greedy except clauses
-----Original Message----- From: Jeremy Hylton [mailto:jeremy@digicool.com] Sent: Saturday, February 10, 2001 1:49 AM To: Chris Withers Cc: Anthony Baxter; Chris McDonough; richard@bizarsoftware.com.au; zope-dev@zope.org Subject: Re: [Zope-dev] Greedy except clauses
"CW" == Chris Withers <chrisw@nipltd.com> writes:
I am probably a bit idiosyncratic, but I prefer to avoid bare excepts at all costs. I often use "except Exception:", otherwise I add a
CW> Will that catch string exceptions? eg: raise 'Something bad CW> happened'
No.
CW> If not, then it's not much use in Zope, which is unfortunately CW> riddled with String exceptions :-S
That might be something worth fixing, too. :-)
Jeremy
I agree. I think this would be a good project for new zope developers to get into the zope code. Would we need an ZopeException class hierarchy? Anthony: can your script be modified to print out the raise statements too <wink>? -------------------------------------------- Tom Jenkins |<xml>Its devIS - Development InfoStructure |all you 703.525.6485 tjenkins@devis.com |need it http://www.devis.com |to be</xml>
"TJ" == Tom Jenkins <TJenkins@DevIS.com> writes:
TJ> I agree. I think this would be a good project for new zope TJ> developers to get into the zope code. Would we need an TJ> ZopeException class hierarchy? IME, it's been a good idea to have a root exception class per subsystem, which all inherit from a single system-wide root, which itself inherits from Exception. That was the motivation for Python's standard exception heirarchy. Greedy excepts have their uses, but IMHO they are limited to `infrastructure wrappers' only. E.g. a CGI wrapper might catch all exceptions so they don't percolate up to the web server, or a command line reader would catch them all so they don't exit the read loop. -Barry
participants (2)
-
barry@digicool.com -
Tom Jenkins