summaryrefslogtreecommitdiffhomepage
path: root/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server.cpp')
-rw-r--r--server.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/server.cpp b/server.cpp
index 26feabc..395be7d 100644
--- a/server.cpp
+++ b/server.cpp
@@ -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());
+ }
}