diff options
| author | Dan Engelbrecht <[email protected]> | 2023-04-26 16:46:44 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2023-04-26 16:49:10 +0200 |
| commit | b213b012c54bf28ae4b571240afd66b3b3de9ee4 (patch) | |
| tree | 5e280e3caf79dec60958dbc2280b7257e9919106 /zenhttp/httpasio.cpp | |
| parent | changelog (diff) | |
| download | zen-b213b012c54bf28ae4b571240afd66b3b3de9ee4.tar.xz zen-b213b012c54bf28ae4b571240afd66b3b3de9ee4.zip | |
Catch any errors throw in HttpAsioServer() destructor and log error to avoid abort due to throwing in destructor
Diffstat (limited to 'zenhttp/httpasio.cpp')
| -rw-r--r-- | zenhttp/httpasio.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/zenhttp/httpasio.cpp b/zenhttp/httpasio.cpp index 510b349f9..79b2c0a3d 100644 --- a/zenhttp/httpasio.cpp +++ b/zenhttp/httpasio.cpp @@ -1296,7 +1296,14 @@ HttpAsioServer::HttpAsioServer() : m_Impl(std::make_unique<asio_http::HttpAsioSe HttpAsioServer::~HttpAsioServer() { - m_Impl->Stop(); + try + { + m_Impl->Stop(); + } + catch (std::exception& ex) + { + ZEN_WARN("Caught exception stopping http asio server: {}", ex.what()); + } } void |