summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-28 17:13:52 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-28 17:13:52 +0100
commitc3dbbec39aef32789aacb872c88801f0c5d15ef7 (patch)
treef935c3ae09246c4dbb714d1fd73a2f874925802f
parentaec2a980fc37bd5d28f06c8e48a98b51ae65ac32 (diff)
downloaddabmod-c3dbbec39aef32789aacb872c88801f0c5d15ef7.tar.gz
dabmod-c3dbbec39aef32789aacb872c88801f0c5d15ef7.tar.bz2
dabmod-c3dbbec39aef32789aacb872c88801f0c5d15ef7.zip
Catch all exceptions as const
-rw-r--r--src/ConfigParser.cpp8
-rw-r--r--src/DabMod.cpp6
-rw-r--r--src/DabModulator.cpp2
-rw-r--r--src/FIRFilter.cpp2
-rw-r--r--src/MemlessPoly.cpp4
-rw-r--r--src/output/UHD.cpp4
6 files changed, 13 insertions, 13 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp
index 69655b4..21f2c23 100644
--- a/src/ConfigParser.cpp
+++ b/src/ConfigParser.cpp
@@ -85,7 +85,7 @@ static void parse_configfile(
auto telnetrc = make_shared<RemoteControllerTelnet>(telnetport);
rcs.add_controller(telnetrc);
}
- catch (std::exception &e) {
+ catch (const std::exception &e) {
std::cerr << "Error: " << e.what() << "\n";
std::cerr << " telnet remote control enabled, but no telnetport defined.\n";
throw std::runtime_error("Configuration error");
@@ -98,7 +98,7 @@ static void parse_configfile(
auto zmqrc = make_shared<RemoteControllerZmq>(zmqCtrlEndpoint);
rcs.add_controller(zmqrc);
}
- catch (std::exception &e) {
+ catch (const std::exception &e) {
std::cerr << "Error: " << e.what() << "\n";
std::cerr << " zmq remote control enabled, but no endpoint defined.\n";
throw std::runtime_error("Configuration error");
@@ -129,7 +129,7 @@ static void parse_configfile(
try {
logfilename = pt.Get("log.filename", "");
}
- catch (std::exception &e) {
+ catch (const std::exception &e) {
std::cerr << "Error: " << e.what() << "\n";
std::cerr << " Configuration enables file log, but does not specify log filename\n";
throw std::runtime_error("Configuration error");
@@ -335,7 +335,7 @@ static void parse_configfile(
try {
mod_settings.tist_offset_s = pt.GetReal("delaymanagement.offset", 0.0);
}
- catch (std::exception &e) {
+ catch (const std::exception &e) {
std::cerr << "Error: delaymanagement: synchronous is enabled, but no offset defined!\n";
throw std::runtime_error("Configuration error");
}
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index 57acd40..ad8101c 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -334,7 +334,7 @@ int launch_modulator(int argc, char* argv[])
try {
ediUdpInput.rxPacket();
}
- catch (std::runtime_error& e) {
+ catch (const std::runtime_error& e) {
etiLog.level(warn) << "EDI input: " << e.what();
running = 0;
break;
@@ -606,13 +606,13 @@ int main(int argc, char* argv[])
try {
return launch_modulator(argc, argv);
}
- catch (std::invalid_argument& e) {
+ catch (const std::invalid_argument& e) {
std::string what(e.what());
if (not what.empty()) {
std::cerr << "Modulator error: " << what << std::endl;
}
}
- catch (std::runtime_error& e) {
+ catch (const std::runtime_error& e) {
std::cerr << "Modulator runtime error: " << e.what() << std::endl;
}
diff --git a/src/DabModulator.cpp b/src/DabModulator.cpp
index 666745d..7e3ccf0 100644
--- a/src/DabModulator.cpp
+++ b/src/DabModulator.cpp
@@ -183,7 +183,7 @@ int DabModulator::process(Buffer* dataOut)
rcs.enrol(tii.get());
tiiRef = make_shared<PhaseReference>(mode);
}
- catch (TIIError& e) {
+ catch (const TIIError& e) {
etiLog.level(error) << "Could not initialise TII: " << e.what();
}
diff --git a/src/FIRFilter.cpp b/src/FIRFilter.cpp
index 8b6fe58..89cf0da 100644
--- a/src/FIRFilter.cpp
+++ b/src/FIRFilter.cpp
@@ -318,7 +318,7 @@ void FIRFilter::set_parameter(const string& parameter, const string& value)
load_filter_taps(value);
m_taps_file = value;
}
- catch (std::runtime_error &e) {
+ catch (const std::runtime_error &e) {
throw ParameterError(e.what());
}
}
diff --git a/src/MemlessPoly.cpp b/src/MemlessPoly.cpp
index 07e4c1a..ef77c07 100644
--- a/src/MemlessPoly.cpp
+++ b/src/MemlessPoly.cpp
@@ -420,7 +420,7 @@ void MemlessPoly::set_parameter(const string& parameter, const string& value)
load_coefficients(coefs_fstream);
m_coefs_file = value;
}
- catch (std::runtime_error &e) {
+ catch (const std::runtime_error &e) {
throw ParameterError(e.what());
}
}
@@ -434,7 +434,7 @@ void MemlessPoly::set_parameter(const string& parameter, const string& value)
ofstream coefs_fstream(m_coefs_file);
coefs_fstream << value;
}
- catch (std::runtime_error &e) {
+ catch (const std::runtime_error &e) {
throw ParameterError(e.what());
}
}
diff --git a/src/output/UHD.cpp b/src/output/UHD.cpp
index 9358072..c6c500b 100644
--- a/src/output/UHD.cpp
+++ b/src/output/UHD.cpp
@@ -432,7 +432,7 @@ bool UHD::is_clk_source_ok(void) const
}
}
}
- catch (uhd::lookup_error &e) {
+ catch (const uhd::lookup_error &e) {
suppress_refclk_loss_check = true;
etiLog.log(warn, "OutputUHD: This USRP does not have mboard "
"sensor for ext clock loss. Check disabled.");
@@ -456,7 +456,7 @@ double UHD::get_temperature(void) const
try {
return std::round(m_usrp->get_tx_sensor("temp", 0).to_real());
}
- catch (uhd::lookup_error &e) {
+ catch (const uhd::lookup_error &e) {
return std::numeric_limits<double>::quiet_NaN();
}
}