1 /* ----------------------------------------------------------------------------- 2 * std_except.i 3 * 4 * Typemaps used by the STL wrappers that throw exceptions. 5 * These typemaps are used when methods are declared with an STL exception specification, such as 6 * size_t at() const throw (std::out_of_range); 7 * ----------------------------------------------------------------------------- */ 8 9 %{ 10 #include <stdexcept> 11 %} 12 13 namespace std 14 { 15 %ignore exception; 16 struct exception {}; 17 } 18 19 %typemap(throws) std::bad_exception %{_swig_gopanic($1.what());%} 20 %typemap(throws) std::domain_error %{_swig_gopanic($1.what());%} 21 %typemap(throws) std::exception %{_swig_gopanic($1.what());%} 22 %typemap(throws) std::invalid_argument %{_swig_gopanic($1.what());%} 23 %typemap(throws) std::length_error %{_swig_gopanic($1.what());%} 24 %typemap(throws) std::logic_error %{_swig_gopanic($1.what());%} 25 %typemap(throws) std::out_of_range %{_swig_gopanic($1.what());%} 26 %typemap(throws) std::overflow_error %{_swig_gopanic($1.what());%} 27 %typemap(throws) std::range_error %{_swig_gopanic($1.what());%} 28 %typemap(throws) std::runtime_error %{_swig_gopanic($1.what());%} 29 %typemap(throws) std::underflow_error %{_swig_gopanic($1.what());%} 30