On Wednesday 08 June 2005 02:32, Fernando Perez wrote: > Jose' Matos wrote: > > Hello, > > I have implemented the --try-hard option. As you can see it will catch > > any python exception in the convertion step and ignore it. > > > > My question is how to warn the user that something wrong happened > > during the convertion? The goal would be to ask the user to report it > > to us. > > Log all exceptions generated at that point, hopefully with a lot of extra > detail about the user variables at that moment at all frames of the > stack. Dump all that to a text file, and ask the user to mail it. You > can even ask if they want it mailed and do it for them automatically > (python has full mailing capabilities built in).
That is an excellent suggestion, thank you. I know about the batteries included of python but some windows packagers would kill me if I used every possible library of standard python. ;-) What this translates to is that I think that for the moment generating that file is enough. :-) > Have a look at IPython's CrashHandler and ultraTB classes, they provide > all that functionality (except I haven't added the auto-email thingie). Thanks for the pointers. > Feel free to lift any of that code and adapt it to your needs. With > those detailed tracebacks, I've often been able to understand and fix > ipython crashes which could only be produced via some obscure > combinations of steps relying on specific user data, input or platform I > don't have access to. And yet the tracebacks contain enough info that I > can figure out what went wrong and fix it on my side. Clearly I had never thought to go so far to be able to get all the debugging information. Thanks for the tip, I will try to implement this over the extended weekend as tomorrow is our national day (therefore holiday). > It's worked extremely well for me over the years. > > Cheers, > > f -- José Abílio