diff options
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()); + } } |