1 2 3 4 5
%include <typemaps/exception.swg> %insert("runtime") { %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; )) }