logo       

Custom exceptions: msg#00360

python.c++

Subject: Custom exceptions

So, let's say I want to register a custom exception which python code can catch, thusly:

try:
doSomething()
except mymodule.MyException e:
print e

Is there anything in boost python that makes setting this up easy? I've got a working exception translator and everything, but I don't see anything equivalent to putting "PyErr_NewException("mymodule.MyException", NULL, NULL)" into the system dictionary during module initialization.

Or am I just working too hard again?

--
Gavin Doughtie
DreamWorks SKG


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise