Skip to content

Commit e5e9b8e

Browse files
authored
[PI-22988] Handle 'failed to connect server' error in noVNC and display appropriate error message (#8)
1 parent ee9f23b commit e5e9b8e

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

app/ui.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ const UI = {
423423
case 'disconnected':
424424
break;
425425
case 'reconnecting':
426-
transitionElem.textContent = _("Reconnecting...");
426+
transitionElem.textContent = _("Connecting...");//Reconnecting state changed to Connecting
427427
document.documentElement.classList.add("noVNC_reconnecting");
428428
break;
429429
default:
@@ -1076,7 +1076,9 @@ const UI = {
10761076
} catch (exc) {
10771077
Log.Error("Failed to connect to server: " + exc);
10781078
UI.updateVisualState('disconnected');
1079-
UI.showStatus(_("Failed to connect to server: ") + exc, 'error');
1079+
if(!UI.getSetting('reconnect', false)) {
1080+
UI.showStatus(_("Failed to connect to server: ") + exc, 'error');
1081+
}
10801082
return;
10811083
}
10821084

@@ -1170,7 +1172,9 @@ const UI = {
11701172
UI.showStatus(_("Something went wrong, connection is closed"),
11711173
'error');
11721174
} else {
1173-
UI.showStatus(_("Failed to connect to server"), 'error');
1175+
if(!UI.getSetting('reconnect', false)) {
1176+
UI.showStatus(_("Failed to connect to server"), 'error');
1177+
}
11741178
}
11751179
}
11761180
// If reconnecting is allowed process it now

0 commit comments

Comments
 (0)