removed Critical and Noncritical exceptions

This commit is contained in:
maliakal_d 2019-06-25 10:50:52 +02:00
parent 4b69c01357
commit 7c18ad3c53
3 changed files with 19 additions and 29 deletions

View File

@ -313,14 +313,14 @@ TEST_CASE(
CHECK(m.getRateCorrection() == ratecorr);
// ratecorr fail with dr 4 or 8
CHECK_THROWS_AS(m.setDynamicRange(8), sls::NonCriticalError);
CHECK_THROWS_AS(m.setDynamicRange(8), sls::RuntimeError);
CHECK(m.getRateCorrection() == 0);
m.setDynamicRange(16);
m.setDynamicRange(16);
m.setRateCorrection(ratecorr);
m.setDynamicRange(16);
m.setRateCorrection(ratecorr);
CHECK_THROWS_AS(m.setDynamicRange(4), sls::NonCriticalError);
CHECK_THROWS_AS(m.setDynamicRange(4), sls::RuntimeError);
CHECK(m.getRateCorrection() == 0);
}
@ -360,11 +360,11 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
m.setPatternWord(addr, word);
CHECK(m.setPatternWord(addr, -1) == word);
addr = MAX_ADDR;
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::NonCriticalError);
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
Catch::Matchers::Contains("be between 0 and"));
addr = -1;
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::NonCriticalError);
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
Catch::Matchers::Contains("be between 0 and"));

View File

@ -3188,7 +3188,7 @@ void slsDetector::updateRateCorrection() {
break;
default:
setRateCorrection(0);
throw sls::NonCriticalError(
throw sls::RuntimeError(
"Rate correction Deactivated, must be in 32 or 16 bit mode");
}
}

View File

@ -27,49 +27,39 @@ public:
}
};
struct CriticalError : public RuntimeError {
struct SharedMemoryError : public RuntimeError {
public:
CriticalError(std::string msg):RuntimeError(msg) {}
SharedMemoryError(std::string msg):RuntimeError(msg) {}
};
struct SharedMemoryError : public CriticalError {
struct SocketError : public RuntimeError {
public:
SharedMemoryError(std::string msg):CriticalError(msg) {}
SocketError(std::string msg):RuntimeError(msg) {}
};
struct SocketError : public CriticalError {
struct ZmqSocketError : public RuntimeError {
public:
SocketError(std::string msg):CriticalError(msg) {}
ZmqSocketError(std::string msg):RuntimeError(msg) {}
};
struct ZmqSocketError : public CriticalError {
struct NotImplementedError : public RuntimeError {
public:
ZmqSocketError(std::string msg):CriticalError(msg) {}
NotImplementedError(std::string msg):RuntimeError(msg) {}
};
struct NonCriticalError : public RuntimeError {
struct DetectorError : public RuntimeError {
public:
NonCriticalError(std::string msg):RuntimeError(msg) {}
DetectorError(std::string msg):RuntimeError(msg) {}
};
struct NotImplementedError : public NonCriticalError {
struct ReceiverError : public RuntimeError {
public:
NotImplementedError(std::string msg):NonCriticalError(msg) {}
ReceiverError(std::string msg):RuntimeError(msg) {}
};
struct DetectorError : public NonCriticalError {
struct GuiError : public RuntimeError {
public:
DetectorError(std::string msg):NonCriticalError(msg) {}
};
struct ReceiverError : public NonCriticalError {
public:
ReceiverError(std::string msg):NonCriticalError(msg) {}
};
struct GuiError : public NonCriticalError {
public:
GuiError(std::string msg):NonCriticalError(msg) {}
GuiError(std::string msg):RuntimeError(msg) {}
};
}