From cd6b9eee92cbb16c4b36f568b812de4dc918eac8 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 21 Oct 2010 15:09:31 -0700 Subject: uhd: install swig exception handler --- gr-uhd/swig/uhd_swig.i | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 @@ -20,6 +20,24 @@ * Boston, MA 02110-1301, USA. */ +//////////////////////////////////////////////////////////////////////// +// 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 //////////////////////////////////////////////////////////////////////// -- cgit