[Zope] ANNOUNCE: #try tag v0.1.0

Jordan B. Baker jbb@spyderlab.com
Thu, 25 Mar 1999 23:59:58 -0500 (EST)


On Thu, 25 Mar 1999, Amos Latteier wrote:

> At 12:32 AM 3/25/99 -0500, you wrote:
> >Okay after I opened my big mouth I had to deliver. :)
> 
> Way to go! This is a great contribution, and I'd love to see it go into the
> standard distribution, assuming that you're agreeable to this.

Thanks.  Yes, please go ahead and use this in the standard distribution
with whatever changes you feel are necessary.
 
> I like this, but how about the fact that Python errors are classes, not
> strings now? This implementation does not allow things like this:
> 
> <!--#try-->
> <!--#call "1/0"-->
> <!--#except ArithmeticError-->
> i got me a math problem
> <!--#/try-->
> 
> Because this implementation has no notion that ZeroDivisionError is a
> subclass of ArithmeticError. I'm not sure how hard it would be to get this
> working, but it would be a nice addition.

I suspect a matter of resolving.  Probably be a two step procedure, 1) try
to match the error by string exactly, otherwise 2) evaluate each handler 
in turn and see if the exception isa class.

> Another small nit is that I think that you should use 'error_message' and
> 'error_type' like standard_error_message does rather than 'errmsg' and
> 'errname'.

I have fixed this in 0.1.1 of the Product which is now available from the
same directory as the original.  I've also made some other additional
fixes relating to the default error handler.

Here's the file:

ftp://ftp.spyderlab.com/pub/zope/Try-0.1.1.tar.gz

Feel free to put this up in the contributed area on zope.org

-------
Jordan B. Baker -- jbb@spyderlab.com
weaving the web @ http://www.spyderlab.com