Provide an error code and error message for failed queued messages
The code below creates an empty error info when a pending message fails. It must also contain a convenient code and message (check spec and other SDKs)

https://github.com/ably/ably-java/blob/94ecb6fada26982aaa698f3291f150f344eb2cd4/lib/src/main/java/io/ably/lib/transport/ConnectionManager.java#L1800
diff --git a/lib/src/main/java/io/ably/lib/transport/ConnectionManager.java b/lib/src/main/java/io/ably/lib/transport/ConnectionManager.java
index 7dbe8b06..8891bd82 100644
--- a/lib/src/main/java/io/ably/lib/transport/ConnectionManager.java
+++ b/lib/src/main/java/io/ably/lib/transport/ConnectionManager.java
@@ -1682,7 +1682,7 @@ public class ConnectionManager implements ConnectListener {
             queuedMessages.clear();
 
             //also pending messages
-            pendingMessages.fail();
+            pendingMessages.fail(reason);
         }
     }
 
@@ -1795,9 +1795,11 @@ public class ConnectionManager implements ConnectListener {
         }
 
         //fail all pending queued emssages
-        synchronized void fail() {
+        synchronized void fail(ErrorInfo reason) {
             for (QueuedMessage queuedMessage: queue){
-                queuedMessage.listener.onError(new ErrorInfo());
+                if (queuedMessage.listener != null) {
+                    queuedMessage.listener.onError(reason);
+                }
             }
             queue.clear();
         }
diff --git a/lib/src/test/java/io/ably/lib/test/common/Helpers.java b/lib/src/test/java/io/ably/lib/test/common/Helpers.java
index 2dce9b10..55c4f3df 100644
--- a/lib/src/test/java/io/ably/lib/test/common/Helpers.java
+++ b/lib/src/test/java/io/ably/lib/test/common/Helpers.java
@@ -174,10 +174,13 @@ public class Helpers {
                     if (System.currentTimeMillis() > timeoutAt) {
                         break;
                     }
-                    
-                     wait(); 
+
+                     wait();
                 } catch(InterruptedException e) {}
             success = successCount >= count;
+            if (error != null) {
+                assertNotNull(error.message);
+            }
             return error;
         }
 
['lib/src/test/java/io/ably/lib/test/common/Helpers.java', 'lib/src/main/java/io/ably/lib/transport/ConnectionManager.java']