From 9d593f25423a547960d844a2c497de46213a020b Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 13 Feb 2019 10:49:15 +0100 Subject: Minor exception refactoring in DabOutputTCP --- src/dabOutput/dabOutputTcp.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src') 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(); - 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; } -- cgit v1.2.3