aboutsummaryrefslogtreecommitdiff
path: root/src/server/authserver/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/authserver/Main.cpp')
-rw-r--r--src/server/authserver/Main.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index cd58ec2bf68..c57f8254d9c 100644
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -58,7 +58,7 @@ boost::asio::deadline_timer _dbPingTimer(_ioService);
uint32 _dbPingInterval;
LoginDatabaseWorkerPool LoginDatabase;
-int main(int argc, char** argv)
+int mainImpl(int argc, char** argv)
{
std::string configFile = _TRINITY_REALM_CONFIG;
auto vm = GetConsoleArguments(argc, argv, configFile);
@@ -144,6 +144,24 @@ int main(int argc, char** argv)
return 0;
}
+/// Launch the Trinity server
+extern int main(int argc, char** argv)
+{
+ try
+ {
+ return mainImpl(argc, argv);
+ }
+ catch (std::exception& ex)
+ {
+ std::cerr << "Top-level exception caught:" << ex.what() << "\n";
+
+#ifndef NDEBUG // rethrow exception for the debugger
+ throw;
+#else
+ return 1;
+#endif
+ }
+}
/// Initialize connection to the database
bool StartDB()