summaryrefslogtreecommitdiff
path: root/Lib/exception.i
diff options
context:
space:
mode:
authorDaniel Vollmer <code@maven.de>2016-09-17 13:24:32 +0200
committerDaniel Vollmer <code@maven.de>2016-09-17 13:24:32 +0200
commitce1cb85d86eac2ad7f8704d056b5bb24cf7bff55 (patch)
tree4f6d4ff2312fcd1b677d4c1705ef4af4dc9728c6 /Lib/exception.i
parent2dc87d7485876d8a7a45d8136014695863e186de (diff)
downloadswig-ce1cb85d86eac2ad7f8704d056b5bb24cf7bff55.tar.gz
Add <typeinfo> header for std::bad_cast
Diffstat (limited to 'Lib/exception.i')
-rw-r--r--Lib/exception.i3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/exception.i b/Lib/exception.i
index c2c9c47ef..c8509987b 100644
--- a/Lib/exception.i
+++ b/Lib/exception.i
@@ -258,6 +258,7 @@ SWIGINTERN void SWIG_DThrowException(int code, const char *msg) {
}
*/
%{
+#include <typeinfo>
#include <stdexcept>
%}
%define SWIG_CATCH_STDEXCEPT
@@ -274,6 +275,8 @@ SWIGINTERN void SWIG_DThrowException(int code, const char *msg) {
SWIG_exception(SWIG_IndexError, e.what() );
} catch (std::runtime_error& e) {
SWIG_exception(SWIG_RuntimeError, e.what() );
+ } catch (std::bad_cast& e) {
+ SWIG_exception(SWIG_TypeError, e.what() );
} catch (std::exception& e) {
SWIG_exception(SWIG_SystemError, e.what() );
}