thx man :)

Date: Wed, 29 Dec 2010 13:37:35 +0000
From: rjniena...@gmail.com
To: users@lists.ironpython.com
Subject: Re: [IronPython] is it possible to raise a System.Web.Exception        
from IronPython?

>  Is there any way tocatch this exception from IronPython

I'm not sure if there's a corresponding python exception but you can definitely 
catch the WebException:

C#:
using System.Net;
public class RaiseException {    public void Raise() { throw new 
WebException("My Exception"); }
}

IronPython 2.6/2.7:

import clrfrom System.Net import WebException
clr.AddReference("RaiseException")import RaiseException
o = RaiseException()try:
    o.Raise()except WebException, e:
    print e.Message     #prints 'My Exception'

On Wed, Dec 29, 2010 at 1:07 PM, Pablo Dalmazzo <pablodalm...@hotmail.com> 
wrote:






Sorry guys, I didnt mean to raise, I wanted to say TO CATCH

From: pablodalm...@hotmail.com
To: users@lists.ironpython.com

Date: Wed, 29 Dec 2010 10:05:07 -0300
Subject: [IronPython] is it possible to raise a System.Web.Exception from       
IronPython?








Hi there,
I was reading Michael's book for exception handling and in the book he says 
when a .NET exception percolates through to IronPython, it’s wrapped as a 
Python exception, and that you can catch a lot of .NET exceptions using the 
equivalent Python exceptions, and he gives a link where there are listed .net 
exception and their equivalents Python exceptions. But  System.Web.Exception 
isnt there. Is there any way to
catch this exception from IronPython or a workaround?
Greetings, Pablo


                                          

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com                   
                  

_______________________________________________

Users mailing list

Users@lists.ironpython.com

http://lists.ironpython.com/listinfo.cgi/users-ironpython.com





_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com                   
                  
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to