         (messageQueue.count == Call.messageQueueMaxLength) {
         throw CallWarning.blocked
       }
-      messageQueue.append(data)
+      messageQueue.append((dataToSend: data, errorHandler: errorHandler))
     } else {
       writing = true
       try sendWithoutBlocking(data: data, errorHandler: errorHandler)

  private var owned: Bool

  /// A queue of pending messages to send over the call
  private var messageQueue: Array<Data>

  /// True if a message write operation is underway
  private var writing: Bool

            self.sendMutex.synchronize {
              // if there are messages pending, send the next one
              if self.messageQueue.count > 0 {
                let (nextMessage, nextErrorHandler) = self.messageQueue.removeFirst()
                do {
                  try self.sendWithoutBlocking(data: nextMessage, errorHandler: nextErrorHandler)
                } catch (let callError) {
                  errorHandler(callError)
                }
