summaryrefslogtreecommitdiff
path: root/share/swig/3.0.12/octave/exception.i
diff options
context:
space:
mode:
Diffstat (limited to 'share/swig/3.0.12/octave/exception.i')
-rw-r--r--share/swig/3.0.12/octave/exception.i14
1 files changed, 14 insertions, 0 deletions
diff --git a/share/swig/3.0.12/octave/exception.i b/share/swig/3.0.12/octave/exception.i
new file mode 100644
index 0000000..2f0f489
--- /dev/null
+++ b/share/swig/3.0.12/octave/exception.i
@@ -0,0 +1,14 @@
+%include <typemaps/exception.swg>
+
+%insert("runtime") {
+ %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; ))
+}
+
+%define SWIG_RETHROW_OCTAVE_EXCEPTIONS
+ /* rethrow any exceptions thrown by Octave */
+%#if SWIG_OCTAVE_PREREQ(4,2,0)
+ catch (octave::execution_exception& _e) { throw; }
+ catch (octave::exit_exception& _e) { throw; }
+ catch (octave::interrupt_exception& _e) { throw; }
+%#endif
+%enddef