diff --git a/websocketpp/impl/connection_impl.hpp b/websocketpp/impl/connection_impl.hpp index 3e4f25f088..65b679b421 100644 --- a/websocketpp/impl/connection_impl.hpp +++ b/websocketpp/impl/connection_impl.hpp @@ -1349,6 +1349,7 @@ void connection::terminate(const lib::error_code & ec) { terminate_status tstat = unknown; if (ec) { + m_ec = ec; m_local_close_code = close::status::abnormal_close; m_local_close_reason = ec.message(); }