From ea89672d186e243fb01bb734e18e47d373bdb661 Mon Sep 17 00:00:00 2001 From: tateisu Date: Thu, 17 Aug 2023 10:13:43 +0900 Subject: [PATCH] =?UTF-8?q?WebSocket=E6=8E=A5=E7=B6=9A=E3=81=8CProtocolExc?= =?UTF-8?q?eption=E3=82=92=E5=87=BA=E3=81=97=E3=81=9F=E9=9A=9B=E3=81=AE?= =?UTF-8?q?=E3=83=AD=E3=82=B0=E5=87=BA=E5=8A=9B=E3=82=92=E7=9F=AD=E3=81=8F?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../subwaytooter/streaming/StreamConnection.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/jp/juggler/subwaytooter/streaming/StreamConnection.kt b/app/src/main/java/jp/juggler/subwaytooter/streaming/StreamConnection.kt index 9ece889e..4d32697c 100644 --- a/app/src/main/java/jp/juggler/subwaytooter/streaming/StreamConnection.kt +++ b/app/src/main/java/jp/juggler/subwaytooter/streaming/StreamConnection.kt @@ -78,6 +78,8 @@ class StreamConnection( // Misskeyの投稿キャプチャ private val capturedId = HashSet() + private var lastUrl = "?" + /////////////////////////////////////////////////////////////////// // methods @@ -375,17 +377,16 @@ class StreamConnection( manager.enqueue { if (t is SocketException && t.message?.contains("closed") == true) { log.v("$name socket closed.") - } else { - log.w(t, "$name WebSocket onFailure.") - } - - if (t is ProtocolException) { + } else if (t is ProtocolException) { + log.w(t.withCaption("$name WebSocket onFailure.") + " " + lastUrl) val msg = t.message if (msg != null && reAuthorizeError.matcher(msg).find()) { log.w("$name seems this server don't support public TL streaming. don't retry…") status = StreamStatus.ClosedNoRetry return@enqueue } + } else { + log.w(t, "$name WebSocket onFailure.") } setStatusClose() @@ -552,6 +553,7 @@ class StreamConnection( } val url = "$prefix$path" + this.lastUrl = url val (result, ws) = try { log.i("webSocket $url")