More detailed error messages if connection closed by peer or network connection was interrupted

This commit is contained in:
Leon Böttger committed 2025-07-25 11:07:45 +02:00
1 parent 8837d0e0aa
commit 24ce9dd677
20 files changed
+79 -2

No files matched your search

+7
View File
@@ -52,6 +52,7 @@ class NearbyConnection {
func start() {
connection.stateUpdateHandler = { state in
if !self.connectionClosed {
if case .ready = state {
self.connectionReady()
@@ -91,6 +92,10 @@ class NearbyConnection {
}
}
if err == .posix(.ENETDOWN) {
self.lastError = NearbyError.protocolError("Error.NetworkDown")
}
self.handleConnectionClosure()
}
}
@@ -133,6 +138,7 @@ class NearbyConnection {
}
if isComplete {
log("Connection closed by peer during receiveFrameAsync")
self.lastError = NearbyError.protocolError("Error.ClosedByPeer".localized())
self.handleConnectionClosure()
return
}
@@ -162,6 +168,7 @@ class NearbyConnection {
}
if isComplete {
log("Connection closed by peer during receiveFrameAsync")
self.lastError = NearbyError.protocolError("Error.ClosedByPeer".localized())
self.handleConnectionClosure()
return
}
+2
View File
@@ -53,6 +53,7 @@
EB96ED8D2D7F7EA3004B3FF1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 69DA9A1329E0BF5200A442DA /* Assets.xcassets */; };
EB96ED8F2D7F8105004B3FF1 /* Localized.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB96ED8E2D7F8103004B3FF1 /* Localized.swift */; };
EB96ED902D7F8114004B3FF1 /* Localized.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB96ED8E2D7F8103004B3FF1 /* Localized.swift */; };
EBC05C592E32C22200EECC18 /* Localized.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB96ED8E2D7F8103004B3FF1 /* Localized.swift */; };
EBCC27F92D80C9F90079C478 /* Zip.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBCC27F82D80C9F70079C478 /* Zip.swift */; };
EBD2A2172D2860C100BCB8E2 /* WelcomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBD2A2162D2860BE00BCB8E2 /* WelcomeScreen.swift */; };
/* End PBXBuildFile section */
@@ -587,6 +588,7 @@
buildActionMask = 2147483647;
files = (
69DCF48D2AB70E8C00CBE2CC /* offline_wire_formats.pb.swift in Sources */,
EBC05C592E32C22200EECC18 /* Localized.swift in Sources */,
EB2F9BFB2DA04B69004010A2 /* Helpers.swift in Sources */,
69DCF48F2AB70E8C00CBE2CC /* securemessage.pb.swift in Sources */,
69DCF4912AB70E9700CBE2CC /* NearbyConnection.swift in Sources */,
+2 -2
View File
@@ -476,8 +476,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
description = NSLocalizedString("Error.Protocol", value: "Communication error", comment: "") + "(\(errorMessage))"
case .ukey2:
description = NSLocalizedString("Error.Crypto", value: "Encryption error", comment: "") + "(\(ne.localizedDescription))"
case .canceled(reason: _):
break // can't happen for incoming transfers
case .canceled(reason: let reason):
description = "Error.Protocol".localized() + " (\(reason))"
}
} else {
description = error.localizedDescription
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Communication error";
"Error.ClosedByPeer" = "The connection was closed. If this happens repeatedly, please restart your phone.";
"Error.NetworkDown" = "The Wi-Fi connection was interrupted. Please check your Wi-Fi connection and try again.";
/* No comment provided by engineer. */
"NFiles" = "%d files";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "خطأ في الاتصال";
"Error.ClosedByPeer" = "تم إغلاق الاتصال. إذا تكرر هذا الأمر، يرجى إعادة تشغيل هاتفك.";
"Error.NetworkDown" = "تم قطع اتصال Wi‑Fi. يرجى التحقق من اتصال Wi‑Fi الخاص بك والمحاولة مرة أخرى.";
/* No comment provided by engineer. */
"NFiles" = "%d ملفات";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Fehler bei der Datenübertragung";
"Error.ClosedByPeer" = "Die Verbindung wurde geschlossen. Wenn das wiederholt passiert, starte bitte dein Handy neu.";
"Error.NetworkDown" = "Die WLAN‑Verbindung wurde unterbrochen. Bitte überprüfe deine WLAN‑Verbindung und versuche es erneut.";
/* No comment provided by engineer. */
"NFiles" = "%d Dateien";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Error de comunicación";
"Error.ClosedByPeer" = "La conexión se cerró. Si esto ocurre repetidamente, reinicia tu teléfono.";
"Error.NetworkDown" = "La conexión Wi‑Fi se interrumpió. Por favor, verifica tu conexión Wi‑Fi e inténtalo de nuevo.";
/* No comment provided by engineer. */
//"NFiles" = "%d archivos";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Erreur de communication";
"Error.ClosedByPeer" = "La connexion a été fermée. Si cela se produit à plusieurs reprises, redémarrez votre téléphone.";
"Error.NetworkDown" = "La connexion Wi‑Fi a été interrompue. Veuillez vérifier votre connexion Wi‑Fi et réessayer.";
/* No comment provided by engineer. */
"NFiles" = "%d fichiers";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Kommunikációs hiba";
"Error.ClosedByPeer" = "A kapcsolat megszakadt. Ha ez többször előfordul, indítsd újra a telefonodat.";
"Error.NetworkDown" = "Megszakadt a Wi‑Fi kapcsolat. Kérlek, ellenőrizd a Wi‑Fi kapcsolatodat, majd próbáld újra.";
/* No comment provided by engineer. */
"NFiles" = "%d fájl";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Errore di comunicazione";
"Error.ClosedByPeer" = "La connessione è stata chiusa. Se ciò accade ripetutamente, riavvia il telefono.";
"Error.NetworkDown" = "La connessione Wi‑Fi è stata interrotta. Controlla la tua connessione Wi‑Fi e riprova.";
/* No comment provided by engineer. */
"NFiles" = "%d files";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "通信エラー";
"Error.ClosedByPeer" = "接続が切断されました。これが繰り返し発生する場合は、スマートフォンを再起動してください。";
"Error.NetworkDown" = "Wi‑Fi 接続が中断されました。Wi‑Fi 接続を確認してから、もう一度お試しください。";
/* No comment provided by engineer. */
"NFiles" = "%dつのファイル";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "통신 오류";
"Error.ClosedByPeer" = "연결이 종료되었습니다. 이러한 문제가 반복되면 휴대전화를 재시작하세요.";
"Error.NetworkDown" = "Wi‑Fi 연결이 끊어졌습니다. Wi‑Fi 연결 상태를 확인하고 다시 시도하세요.";
/* No comment provided by engineer. */
"NFiles" = "%d개의 파일";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Communicatiefout";
"Error.ClosedByPeer" = "De verbinding is verbroken. Als dit herhaaldelijk gebeurt, start dan je telefoon opnieuw op.";
"Error.NetworkDown" = "De Wi‑Fi‑verbinding is onderbroken. Controleer je Wi‑Fi‑verbinding en probeer het opnieuw.";
/* No comment provided by engineer. */
"NFiles" = "%d bestanden";
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Erro de comunicação";
"Error.ClosedByPeer" = "A conexão foi encerrada. Se isso acontecer repetidamente, reinicie o seu celular.";
"Error.NetworkDown" = "A ligação Wi‑Fi foi interrompida. Verifica a tua ligação Wi‑Fi e tenta novamente.";
/* No comment provided by engineer. */
"NFiles" = "%d arquivos";
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Erro de comunicação";
"Error.ClosedByPeer" = "A ligação foi encerrada. Se isto acontecer repetidamente, reinicia o teu telemóvel.";
"Error.NetworkDown" = "A ligação Wi‑Fi foi interrompida. Verifica a tua ligação Wi‑Fi e tenta novamente.";
/* No comment provided by engineer. */
"NFiles" = "%d ficheiros";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Eroare de comunicare";
"Error.ClosedByPeer" = "Conexiunea a fost închisă. Dacă se întâmplă în mod repetat, repornește telefonul.";
"Error.NetworkDown" = "Conexiunea Wi‑Fi a fost întreruptă. Verifică conexiunea Wi‑Fi și încearcă din nou.";
/* No comment provided by engineer. */
"NFiles" = "%d fișiere";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Ошибка протокола";
"Error.ClosedByPeer" = "Соединение было закрыто. Если это происходит неоднократно, перезагрузите телефон.";
"Error.NetworkDown" = "Соединение по Wi‑Fi было прервано. Пожалуйста, проверьте соединение Wi‑Fi и попробуйте снова.";
/* No comment provided by engineer. */
/*"NFiles" = "%d файлов";*/
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "การสื่อสารผิดพลาด";
"Error.ClosedByPeer" = "การเชื่อมต่อถูกปิด หากเกิดขึ้นซ้ำหลายครั้ง โปรดรีสตาร์ทโทรศัพท์ของคุณ";
"Error.NetworkDown" = "การเชื่อมต่อ Wi‑Fi ถูกขัดจังหวะ โปรดตรวจสอบการเชื่อมต่อ Wi‑Fi ของคุณแล้วลองอีกครั้ง";
/* No comment provided by engineer. */
"NFiles" = "%d ไฟล์";
+4
View File
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "Помилка протоколу";
"Error.ClosedByPeer" = "З'єднання було закрито. Якщо це трапляється постійно, перезавантажте телефон.";
"Error.NetworkDown" = "З’єднання Wi‑Fi було перервано. Будь ласка, перевірте своє Wi‑Fi з’єднання та спробуйте ще раз.";
/* No comment provided by engineer. */
"NFiles" = "%d files";
@@ -24,6 +24,10 @@
/* No comment provided by engineer. */
"Error.Protocol" = "通信出错";
"Error.ClosedByPeer" = "连接已关闭。如果这种情况反复发生,请重启手机。";
"Error.NetworkDown" = "Wi‑Fi 连接中断。请检查您的 Wi‑Fi 连接并重试。";
/* No comment provided by engineer. */
"NFiles" = "%d files";