Enhance exception throwing with Boost Exception library
Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4962ba
Refs: #2997
diff --git a/src/transport/tcp-transport.cpp b/src/transport/tcp-transport.cpp
index c43790f..afde1e0 100644
--- a/src/transport/tcp-transport.cpp
+++ b/src/transport/tcp-transport.cpp
@@ -57,8 +57,8 @@
const std::string scheme = uri.getScheme();
if (scheme != "tcp" && scheme != "tcp4" && scheme != "tcp6") {
- throw Transport::Error("Cannot create TcpTransport from \"" +
- scheme + "\" URI");
+ BOOST_THROW_EXCEPTION(Transport::Error("Cannot create TcpTransport from \"" +
+ scheme + "\" URI"));
}
if (!uri.getHost().empty()) {
@@ -70,7 +70,7 @@
}
}
catch (const util::FaceUri::Error& error) {
- throw ConfigFile::Error(error.what());
+ BOOST_THROW_EXCEPTION(ConfigFile::Error(error.what()));
}
return {host, port};