summaryrefslogtreecommitdiff
path: root/src/webserver_main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webserver_main.cpp')
-rw-r--r--src/webserver_main.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp
index bf98aae73b..b613008360 100644
--- a/src/webserver_main.cpp
+++ b/src/webserver_main.cpp
@@ -61,7 +61,7 @@ inline void setupSocket(crow::App& app)
}
}
-int main(int /*argc*/, char** /*argv*/)
+int run()
{
crow::Logger::setLogLevel(crow::LogLevel::Debug);
@@ -146,3 +146,16 @@ int main(int /*argc*/, char** /*argv*/)
crow::connections::systemBus.reset();
return 0;
}
+
+int main(int /*argc*/, char** /*argv*/)
+{
+ try
+ {
+ return run();
+ }
+ catch (...)
+ {
+ return -1;
+ BMCWEB_LOG_CRITICAL << "Threw exception to main";
+ }
+}