diff options
author | Tom Rondeau <trondeau@vt.edu> | 2011-10-06 18:57:39 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2011-10-06 18:57:39 -0400 |
commit | 132a3c185b47263398d38b6b454e5c990b02b52f (patch) | |
tree | 2adb62830b9e5f0fe187a745e6b310f2a82f8987 /gruel/src/swig/pmt_swig.i | |
parent | e0e396d541673260fcab7b48f3c462b390b508c8 (diff) | |
parent | 42b034d07f7d27f3c645bebd0aed01f358e669bb (diff) |
Merge branch 'digital' of github.com:trondeau/gnuradio into digital
Diffstat (limited to 'gruel/src/swig/pmt_swig.i')
-rw-r--r-- | gruel/src/swig/pmt_swig.i | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gruel/src/swig/pmt_swig.i b/gruel/src/swig/pmt_swig.i index 3b0eb45c88..34c7d4b7cf 100644 --- a/gruel/src/swig/pmt_swig.i +++ b/gruel/src/swig/pmt_swig.i @@ -36,6 +36,24 @@ using namespace pmt; %} +//////////////////////////////////////////////////////////////////////// +// 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"); + } + +} + // Template intrusive_ptr for Swig to avoid dereferencing issues class pmt_base; //%import <intrusive_ptr.i> |