summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2010-10-21 15:09:31 -0700
committerJosh Blum2010-10-21 15:09:31 -0700
commitcd6b9eee92cbb16c4b36f568b812de4dc918eac8 (patch)
tree152178589c8fd1c03dfd966f82abbe392f6fd502
parent13970fed3ae4114689d08bf01cee8b8706d316a5 (diff)
downloadgnuradio-cd6b9eee92cbb16c4b36f568b812de4dc918eac8.tar.gz
gnuradio-cd6b9eee92cbb16c4b36f568b812de4dc918eac8.tar.bz2
gnuradio-cd6b9eee92cbb16c4b36f568b812de4dc918eac8.zip
uhd: install swig exception handler
-rw-r--r--gr-uhd/swig/uhd_swig.i18
1 files changed, 18 insertions, 0 deletions
diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i
index 6f29f706d..5b3b52472 100644
--- a/gr-uhd/swig/uhd_swig.i
+++ b/gr-uhd/swig/uhd_swig.i
@@ -21,6 +21,24 @@
*/
////////////////////////////////////////////////////////////////////////
+// Language independent exception handler
+////////////////////////////////////////////////////////////////////////
+%include exception.i
+
+%exception {
+ try {
+ $action
+ }
+ catch(std::exception &e) {
+ SWIG_exception(SWIG_RuntimeError, e.what());
+ }
+ catch(...) {
+ SWIG_exception(SWIG_RuntimeError, "Unknown exception");
+ }
+
+}
+
+////////////////////////////////////////////////////////////////////////
// standard includes
////////////////////////////////////////////////////////////////////////
%include "gnuradio.i"