aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/SignalCatch.cpp
blob: ad92d28904745d60a0d49da08e594e1878b412eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#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");
}