diff options
Diffstat (limited to 'include/gras/element.i')
-rw-r--r-- | include/gras/element.i | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/gras/element.i b/include/gras/element.i index 8dc360b..f826ca8 100644 --- a/include/gras/element.i +++ b/include/gras/element.i @@ -13,6 +13,18 @@ #pragma SWIG nowarn=401 //////////////////////////////////////////////////////////////////////// +// http://www.swig.org/Doc2.0/Library.html#Library_stl_exceptions +//////////////////////////////////////////////////////////////////////// +%include <exception.i> + +%exception +{ + try{$action} + catch (const std::exception& e) + {SWIG_exception(SWIG_RuntimeError, e.what());} +} + +//////////////////////////////////////////////////////////////////////// // Export swig element comprehension //////////////////////////////////////////////////////////////////////// %include <std_string.i> |