diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2023-12-02 01:45:21 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2023-12-02 02:42:50 +0300 |
commit | 9c43d58f75cf086b744cf4fe2ae180e8f37e4a0c (patch) | |
tree | 9f88a486917d371d099cd712efd91b4c122d209d /contrib/tools/swig/Lib/go/std_except.i | |
parent | 32fb6dda1feb24f9ab69ece5df0cb9ec238ca5e6 (diff) | |
download | ydb-9c43d58f75cf086b744cf4fe2ae180e8f37e4a0c.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/tools/swig/Lib/go/std_except.i')
-rw-r--r-- | contrib/tools/swig/Lib/go/std_except.i | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/contrib/tools/swig/Lib/go/std_except.i b/contrib/tools/swig/Lib/go/std_except.i new file mode 100644 index 0000000000..4f021a1264 --- /dev/null +++ b/contrib/tools/swig/Lib/go/std_except.i @@ -0,0 +1,31 @@ +/* ----------------------------------------------------------------------------- + * std_except.i + * + * Typemaps used by the STL wrappers that throw exceptions. + * These typemaps are used when methods are declared with an STL exception specification, such as + * size_t at() const throw (std::out_of_range); + * ----------------------------------------------------------------------------- */ + +%{ +#include <typeinfo> +#include <stdexcept> +%} + +namespace std +{ + %ignore exception; + struct exception {}; +} + +%typemap(throws) std::bad_cast %{_swig_gopanic($1.what());%} +%typemap(throws) std::bad_exception %{_swig_gopanic($1.what());%} +%typemap(throws) std::domain_error %{_swig_gopanic($1.what());%} +%typemap(throws) std::exception %{_swig_gopanic($1.what());%} +%typemap(throws) std::invalid_argument %{_swig_gopanic($1.what());%} +%typemap(throws) std::length_error %{_swig_gopanic($1.what());%} +%typemap(throws) std::logic_error %{_swig_gopanic($1.what());%} +%typemap(throws) std::out_of_range %{_swig_gopanic($1.what());%} +%typemap(throws) std::overflow_error %{_swig_gopanic($1.what());%} +%typemap(throws) std::range_error %{_swig_gopanic($1.what());%} +%typemap(throws) std::runtime_error %{_swig_gopanic($1.what());%} +%typemap(throws) std::underflow_error %{_swig_gopanic($1.what());%} |