emit remoteauth error on unexpected close

This commit is contained in:
ouwou committed 2023-07-09 21:27:08 -04:00
1 parent aaa219ce27
commit 3c2fde661e
1 file changed
+6
+6
View File
@@ -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 + ")");
}
}
}