[Chicago] How to know more about the raised exception?

Cosmin Stejerean cstejerean at gmail.com
Sun Nov 4 19:09:06 CET 2007


You can create a new exception class in which you can wrap other exceptions
and raise that instead. So your error handling code can easily know if it's
an "original" exception or an exception you raised.

- Cosmin

On 11/4/07, Timmy <timheit at netvigator.com> wrote:
>
> Hi,
>    I has a question about exception in python.
>    I know that an exception can be re-raised.
> Is there any simple way provided by python itself that I can know the
> current exception is
> just firstly occurred or it is re-raised by previous exception?
> I need to know whether it is firstly occurred or not
> because I want to just display an error message if it's
> firstly occur and skip display error message if the exception is just
> re-raised by previous exception.
>
> Thanks!
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago
>



-- 
Cosmin Stejerean
http://blog.offbytwo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/chicago/attachments/20071104/11c10e46/attachment.htm 


More information about the Chicago mailing list