Capturing Python run-time exceptions ...

Richard Sharpe realrichardsharpe at gmail.com
Sun Mar 25 22:16:40 MDT 2012


2012/3/25 Richard Sharpe <realrichardsharpe at gmail.com>:
> Hi Folks,
>
> I need to get the following errors:
>
>       RuntimeError: (-1073741790, 'Access denied')
>
> It looks like I can do something like:
>
>    try:
>        some statements
>    except RuntimeError:
>        other statements
>
> It seems like there is a set there with two entries. How do I get
> access to those values.

OK, I found it in my Python book.

    except RuntimeError, val:

then val is the info that was printed by the default handler.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)


More information about the samba-technical mailing list