Saizan wrote:
>Thanks, I had completely missed the module traceback...
>I'll use traceback.print_exc(), it seems the most straightforward way.
>The only flaw is that the traceback starts in the method where i catch the
>exception and not from "__main__", but I guess it can't be helped.
>
>
Actu
Thanks, I had completely missed the module traceback...
I'll use traceback.print_exc(), it seems the most straightforward way.
The only flaw is that the traceback starts in the method where i catch the
exception and not from "__main__", but I guess it can't be helped.
--
http://mail.python.org/ma
I find the following very good for most needs:
try:
raise RuntimeError('err')
except:
import traceback;traceback.print_exc()
-- if you use Pydev, there's a template for that called printexc.
Cheers,
Fabio
Saizan wrote:
>In an event-driven application i'd like to keep the program alive
Op 2006-02-01, Saizan schreef <[EMAIL PROTECTED]>:
> In an event-driven application i'd like to keep the program alive regardless
> of any exceptions raised by the handlers,
> but still be able to debug them by reading the appropriate TraceBack from
> stderr.
> I can put something like:
>
> try:
Saizan wrote:
> In an event-driven application i'd like to keep the program alive
> regardless of any exceptions raised by the handlers, but still be able to
> debug them by reading the appropriate TraceBack from stderr. I can put
> something like:
See
sys.exc_info()
The you can do:
try:
.
In an event-driven application i'd like to keep the program alive regardless of
any exceptions raised by the handlers,
but still be able to debug them by reading the appropriate TraceBack from
stderr.
I can put something like:
try:
self.call_handler(handler,*args)
except Exception, e: