How to propagate an exception ?

Oleg Broytmann phd at phd.pp.ru
Sat May 18 08:52:42 EDT 2002


On Sat, May 18, 2002 at 05:28:42AM -0700, Shagshag wrote:
> How do you propagate an exception ? Is there a way to raise the
> previous exception raised after doing something ?
> 
> Here what i would like to do :
> 
> try:
>     some_parsing_with_minidom(from_a_line)
> except SAXParseException: # (1)
>     # there are trouble in my file such as & instead of &
>     # and other things which prevent correct parsing but 
>     # i don't know where and what cause my trouble
>     print index_of_line, line
>     raise SAXParseException #<- should be the one i intercept in (1)

   Just "raise" without a name.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list