From b35578bac3b1b53bc68304cbc1efeed327916037 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Wed, 11 Mar 2015 21:07:08 +0100 Subject: Revert "Core/Server: Catch exceptions in int main()" This reverts commit e68ca82d4d039a401d03de145111b0a738bb9dd7. Closes #14329 --- src/server/bnetserver/Main.cpp | 19 +------------------ src/server/worldserver/Main.cpp | 22 ++-------------------- 2 files changed, 3 insertions(+), 38 deletions(-) (limited to 'src/server') diff --git a/src/server/bnetserver/Main.cpp b/src/server/bnetserver/Main.cpp index ab7c91512e2..5f4f63287e5 100644 --- a/src/server/bnetserver/Main.cpp +++ b/src/server/bnetserver/Main.cpp @@ -61,7 +61,7 @@ boost::asio::deadline_timer _dbPingTimer(_ioService); uint32 _dbPingInterval; LoginDatabaseWorkerPool LoginDatabase; -int mainImpl(int argc, char** argv) +int main(int argc, char** argv) { std::string configFile = _TRINITY_BNET_CONFIG; auto vm = GetConsoleArguments(argc, argv, configFile); @@ -156,23 +156,6 @@ int mainImpl(int argc, char** argv) return 0; } -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() diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 362b5b05168..15d08a903b9 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -97,7 +97,8 @@ void ShutdownThreadPool(std::vector& threadPool); bool LoadRealmInfo(); variables_map GetConsoleArguments(int argc, char** argv, std::string& cfg_file, std::string& cfg_service); -int mainImpl(int argc, char** argv) +/// Launch the Trinity server +extern int main(int argc, char** argv) { std::string configFile = _TRINITY_CORE_CONFIG; std::string configService; @@ -305,25 +306,6 @@ int mainImpl(int argc, char** argv) return World::GetExitCode(); } -/// 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 - } -} - void ShutdownCLIThread(std::thread* cliThread) { if (cliThread != nullptr) -- cgit v1.2.3