diff --git a/ammolite/src/main/java/com/vitorpamplona/ammolite/relays/Relay.kt b/ammolite/src/main/java/com/vitorpamplona/ammolite/relays/Relay.kt index 7d6bf3e1d..86a85a8a4 100644 --- a/ammolite/src/main/java/com/vitorpamplona/ammolite/relays/Relay.kt +++ b/ammolite/src/main/java/com/vitorpamplona/ammolite/relays/Relay.kt @@ -233,20 +233,20 @@ class Relay( // checks if this is an actual failure. Closing the socket generates an onFailure as well. if (!(socket == null && (t.message == "Socket is closed" || t.message == "Socket closed"))) { RelayStats.newError(url, response?.message ?: t.message) - - Log.w("Relay", "Relay onFailure $url, ${response?.message} $response ${t.message} $socket") - t.printStackTrace() - listeners.forEach { - it.onError( - this@Relay, - "", - Error("WebSocket Failure. Response: $response. Exception: ${t.message}", t), - ) - } } // Failures disconnect the relay. markConnectionAsClosed() + + Log.w("Relay", "Relay onFailure $url, ${response?.message} $response ${t.message} $socket") + t.printStackTrace() + listeners.forEach { + it.onError( + this@Relay, + "", + Error("WebSocket Failure. Response: $response. Exception: ${t.message}", t), + ) + } } }