[vtkusers] C++ exceptions and python

tom fogal tfogal at apollo.sr.unh.edu
Thu Sep 16 10:47:28 EDT 2004


We have a custom object that doesn't really cope with error handling
very well, and as we were thinking about how/where to add it in, we
thought using exceptions would be the natural choice for reporting
these errors.

We're making a lot of code in python that uses the object. Is it
perhaps possible to throw a C++ exception and catch it in python? This
sounds difficult but I noticed a small thread about it on the ITK
mailing list
(http://public.kitware.com/pipermail/insight-users/2003-July/004301.html)
but I don't know how much (if any) progress has been made. It seemed to
fall back on using SWIG too, which I believe VTK does not utilize.

Has anyone run into this issue before? What did you do to solve the
problem?

-tom



More information about the vtkusers mailing list