Provide full stacktrace in case of uncaught exception during server start

Without it, it is hard to understand where the problem is.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2022-11-18 13:22:55 +01:00
parent de562a654b
commit eb3d21831d
2 changed files with 14 additions and 0 deletions

View File

@ -262,6 +262,7 @@ void Keeper::defineOptions(Poco::Util::OptionSet & options)
}
int Keeper::main(const std::vector<std::string> & /*args*/)
try
{
Poco::Logger * log = &logger();
@ -473,6 +474,12 @@ int Keeper::main(const std::vector<std::string> & /*args*/)
return Application::EXIT_OK;
}
catch (...)
{
/// Poco does not provide stacktrace.
tryLogCurrentException("Application");
throw;
}
void Keeper::logRevision() const

View File

@ -647,6 +647,7 @@ static void sanityChecks(Server & server)
}
int Server::main(const std::vector<std::string> & /*args*/)
try
{
Poco::Logger * log = &logger();
@ -1845,6 +1846,12 @@ int Server::main(const std::vector<std::string> & /*args*/)
return Application::EXIT_OK;
}
catch (...)
{
/// Poco does not provide stacktrace.
tryLogCurrentException("Application");
throw;
}
std::unique_ptr<TCPProtocolStackFactory> Server::buildProtocolStackFromConfig(
const Poco::Util::AbstractConfiguration & config,