From 3c2fde661e0d8240fa03290c28e1475330ca15b2 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 9 Jul 2023 21:27:08 -0400 Subject: emit remoteauth error on unexpected close --- src/remoteauth/remoteauthclient.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/remoteauth/remoteauthclient.cpp b/src/remoteauth/remoteauthclient.cpp index 083bdaa..7f41d71 100644 --- a/src/remoteauth/remoteauthclient.cpp +++ b/src/remoteauth/remoteauthclient.cpp @@ -264,8 +264,14 @@ void RemoteAuthClient::OnWebsocketOpen() { void RemoteAuthClient::OnWebsocketClose(const ix::WebSocketCloseInfo &info) { if (info.remote) { m_log->debug("Websocket closed (remote): {} ({})", info.code, info.reason); + if (m_connected) { + m_signal_error.emit("Error. Websocket closed (remote): " + std::to_string(info.code) + " (" + info.reason + ")"); + } } else { m_log->debug("Websocket closed (local): {} ({})", info.code, info.reason); + if (m_connected) { + m_signal_error.emit("Error. Websocket closed (local): " + std::to_string(info.code) + " (" + info.reason + ")"); + } } } -- cgit v1.2.3