1 from director_exception import *
3 class MyException(Exception):
4 def __init__(self, a, b):
9 raise NotImplementedError, "MyFoo::ping() EXCEPTION"
14 pass # error: should return a string
18 raise MyException("foo", "bar")
20 # Check that the NotImplementedError raised by MyFoo.ping() is returned by
27 except NotImplementedError, e:
28 if str(e) == "MyFoo::ping() EXCEPTION":
31 print "Unexpected error message: %s" % str(e)
38 # Check that the director returns the appropriate TypeError if the return type
46 if str(e) == "Swig director type mismatch in output value of type 'std::string'":
49 print "Unexpected error message: %s" % str(e)
54 # Check that the director can return an exception which requires two arguments
55 # to the constructor, without mangling it.
61 except MyException, e:
65 print "Unexpected error message: %s" % str(e)