From 9800136e4e2e32f5f78fdfb4314bd5d8da741ce1 Mon Sep 17 00:00:00 2001 From: Paddy Byers Date: Wed, 25 Jul 2018 10:48:15 +0100 Subject: [PATCH] Add/improve a couple of log messages --- lib/src/main/java/io/ably/lib/realtime/Channel.java | 1 + .../java/io/ably/lib/test/realtime/RealtimeChannelTest.java | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/src/main/java/io/ably/lib/realtime/Channel.java b/lib/src/main/java/io/ably/lib/realtime/Channel.java index fa7238488..8dd786afd 100644 --- a/lib/src/main/java/io/ably/lib/realtime/Channel.java +++ b/lib/src/main/java/io/ably/lib/realtime/Channel.java @@ -954,6 +954,7 @@ void onChannelMessage(ProtocolMessage msg) { attachWithTimeout(null); } catch (AblyException e) { /* Send message error */ + Log.e(TAG, "Attempting reattach threw exception", e); setDetached(e.errorInfo); } break; diff --git a/lib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java b/lib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java index 5d39134b9..69e151d03 100644 --- a/lib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java +++ b/lib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java @@ -1408,10 +1408,11 @@ public void channel_reattach_failed_timeout() { } catch(AblyException e) { e.printStackTrace(); - fail("Unexpected exception"); + fail("channel_reattach_failed_timeout: unexpected exception"); } finally { - if (ably != null) + if (ably != null) { ably.close(); + } /* Restore default values to run other tests */ Defaults.TRANSPORT = oldTransportFractory; Defaults.realtimeRequestTimeout = oldRealtimeTimeout;