diff options
Diffstat (limited to 'src/crepe/facade/SignalCatch.cpp')
-rw-r--r-- | src/crepe/facade/SignalCatch.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/crepe/facade/SignalCatch.cpp b/src/crepe/facade/SignalCatch.cpp new file mode 100644 index 0000000..4988047 --- /dev/null +++ b/src/crepe/facade/SignalCatch.cpp @@ -0,0 +1,20 @@ +#include <stdexcept> + +#include "SignalCatch.h" + +using namespace crepe; +using namespace std; + +SignalCatch::SignalCatch() { + segvcatch::init_segv(&SignalCatch::segv); + segvcatch::init_fpe(&SignalCatch::fpe); +} + +SignalCatch::~SignalCatch() { + segvcatch::init_segv(); + segvcatch::init_fpe(); +} + +void SignalCatch::segv() { throw runtime_error("segmentation fault"); } + +void SignalCatch::fpe() { throw domain_error("floating point exception"); } |