summaryrefslogtreecommitdiffhomepage
path: root/server.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-04-11 13:17:32 +0200
committerRoland Reichwein <mail@reichwein.it>2020-04-11 13:17:32 +0200
commit6081819802972c716745a44e3521ccb3b3cf7b1a (patch)
treed1dafa4b821acff243f1613d2dd483e49782ff0b /server.cpp
parent07f01d1ab5e68fc042356fd90fa07c199791b29c (diff)
Support IPv6
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());
+ }
}