diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-04-11 13:17:32 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-04-11 13:17:32 +0200 |
commit | 6081819802972c716745a44e3521ccb3b3cf7b1a (patch) | |
tree | d1dafa4b821acff243f1613d2dd483e49782ff0b /server.cpp | |
parent | 07f01d1ab5e68fc042356fd90fa07c199791b29c (diff) |
Support IPv6
Diffstat (limited to 'server.cpp')
-rw-r--r-- | server.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -18,6 +18,8 @@ #include <boost/asio/strand.hpp> #include <boost/config.hpp> +#include <exception> +#include <iostream> #include <thread> #include <vector> @@ -92,6 +94,14 @@ const Socket& Server::GetSocket() plugin_type Server::GetPlugin(const std::string& name) { - return m_plugins.at(name); // Config validation made sure that we will find it here. For safety, a thrown exception will be caught in webserver.cpp + try { + return m_plugins.at(name); + } catch (const std::out_of_range& ex) { + std::cout << "Out of range at Server::GetPlugin(): " << name << std::endl; + std::rethrow_exception(std::current_exception()); + } catch (...) { + std::cout << "Unknown exception at Server::GetPlugin(): " << name << std::endl; + std::rethrow_exception(std::current_exception()); + } } |