Re: Bug? Catching exceptions in tag libraries

"Jonathan Ellis" <[email protected]> Tue, 12 Sep 2006 06:15:18 -0700
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
fixed in 1178

On Tue, 12 Sep 2006 12:19:11 +0200, "Iwan Vosloo" <[email protected]> said:
> Hi there,
> 
> I believe I may have found a bug.  I'm still on an older version of the
> spyce 2.1 tree (revision 1153), so it may also have been fixed already.
> I'd love to know whether this is the case or not...
> 
> I would expect to be passed the raised exception instance in catch(),
> but it seems that the exception class is passed instead in the code
> below.
> 
> -i
> 
> ---------------------------- reproduce.py ---------------------
> import spyceTag
> 
> class TestException(Exception):
>     pass
> 
> class Catch(spyceTag.spyceTagPlus):
>   name = 'catch'
>   catches = True
>   def begin(self):
>       raise TestException('stuff')
>   
>   def catch(self, ex):
>       print type(ex) # Here's where I get <type 'classobj'>, instead
>                      # of the expected <type 'instance'>
> 
> 
> class reproduce(spyceTag.spyceTagLibrary):
>   tags = [
>     Catch
>   ]
> 
> 
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Spyce-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/spyce-users
-- 
C++ is history repeated as tragedy. Java is history repeated as farce.  --Scott McKay


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642