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.<br><br>
- Cosmin<br><br><div><span class="gmail_quote">On 11/4/07, <b class="gmail_sendername">Timmy</b> <<a href="mailto:timheit@netvigator.com">timheit@netvigator.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br> I has a question about exception in python.<br> I know that an exception can be re-raised.<br>Is there any simple way provided by python itself that I can know the current exception is<br>just firstly occurred or it is re-raised by previous exception?
<br>I need to know whether it is firstly occurred or not<br>because I want to just display an error message if it's<br>firstly occur and skip display error message if the exception is just re-raised by previous exception.
<br><br>Thanks!<br><br>_______________________________________________<br>Chicago mailing list<br><a href="mailto:Chicago@python.org">Chicago@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/chicago">http://mail.python.org/mailman/listinfo/chicago
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Cosmin Stejerean<br><a href="http://blog.offbytwo.com">http://blog.offbytwo.com</a>