summaryrefslogtreecommitdiff
path: root/linux-x86/share/swig/r/exception.i
diff options
context:
space:
mode:
Diffstat (limited to 'linux-x86/share/swig/r/exception.i')
-rw-r--r--linux-x86/share/swig/r/exception.i8
1 files changed, 8 insertions, 0 deletions
diff --git a/linux-x86/share/swig/r/exception.i b/linux-x86/share/swig/r/exception.i
new file mode 100644
index 0000000..39cb095
--- /dev/null
+++ b/linux-x86/share/swig/r/exception.i
@@ -0,0 +1,8 @@
+%include <typemaps/exception.swg>
+
+
+%insert("runtime") {
+ %define_as(SWIG_exception(code, msg),
+%block(switch (code) {case SWIG_IndexError: return Rf_ScalarLogical(NA_LOGICAL); default: %error(code, msg); SWIG_fail;} ))
+}
+