summaryrefslogtreecommitdiffstats
path: root/src/dabOutput
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-02-13 10:49:15 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-02-13 10:49:15 +0100
commit9d593f25423a547960d844a2c497de46213a020b (patch)
tree85bfabba29778cd21acd0327519325fd5e5ec588 /src/dabOutput
parent9e9e3e49ac5fe724e9a987c2502c5f208c5aea65 (diff)
downloaddabmux-9d593f25423a547960d844a2c497de46213a020b.tar.gz
dabmux-9d593f25423a547960d844a2c497de46213a020b.tar.bz2
dabmux-9d593f25423a547960d844a2c497de46213a020b.zip
Minor exception refactoring in DabOutputTCP
Diffstat (limited to 'src/dabOutput')
-rw-r--r--src/dabOutput/dabOutputTcp.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/dabOutput/dabOutputTcp.cpp b/src/dabOutput/dabOutputTcp.cpp
index 57dc706..7fb17ca 100644
--- a/src/dabOutput/dabOutputTcp.cpp
+++ b/src/dabOutput/dabOutputTcp.cpp
@@ -107,7 +107,7 @@ class TCPConnection
}
while (sent == 0);
}
- catch (std::runtime_error& e) {
+ catch (const std::runtime_error& e) {
m_running = false;
}
}
@@ -159,7 +159,7 @@ class TCPDataDispatcher
}
}
}
- catch (std::runtime_error& e) {
+ catch (const std::runtime_error& e) {
etiLog.level(error) << "TCPDataDispatcher caught runtime error: " << e.what();
m_running = false;
}
@@ -218,19 +218,10 @@ int DabOutputTcp::Open(const char* name)
if (success) {
dispatcher_ = make_shared<TCPDataDispatcher>();
- try {
- dispatcher_->start(port, address);
- }
- catch (std::runtime_error& e) {
- stringstream ss;
- ss << "Caught error during socket open of TCP output " << name;
- throw e;
- }
+ dispatcher_->start(port, address);
}
else {
- stringstream ss;
- ss << "Could not parse TCP output address " << name;
- throw std::runtime_error(ss.str());
+ throw runtime_error(string("Could not parse TCP output address ") + name);
}
return 0;
}