]> source.dussan.org Git - tigervnc.git/commitdiff
Throw more descriptive error on rect read error
authorPierre Ossman <ossman@cendio.se>
Thu, 4 Nov 2021 08:00:33 +0000 (09:00 +0100)
committerPierre Ossman <ossman@cendio.se>
Thu, 4 Nov 2021 08:00:33 +0000 (09:00 +0100)
Gives a bit more context where this error happened.

common/rfb/DecodeManager.cxx

index 4f60cd596f3b71bc3b9eb0dfb0d4c0a1e7012510..720aabeda7f186555c8c16b21851c6f234e67fda 100644 (file)
@@ -136,8 +136,12 @@ bool DecodeManager::decodeRect(const Rect& r, int encoding,
 
   // Read the rect
   bufferStream->clear();
-  if (!decoder->readRect(r, conn->getInStream(), conn->server, bufferStream))
-    return false;
+  try {
+    if (!decoder->readRect(r, conn->getInStream(), conn->server, bufferStream))
+      return false;
+  } catch (rdr::Exception& e) {
+    throw Exception("Error reading rect: %s", e.str());
+  }
 
   // Then try to put it on the queue
   entry = new QueueEntry;