From 0ce9fefde8c0b34eda0d6c2454abb8fece7e6e3c Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 4 Nov 2021 09:00:33 +0100 Subject: [PATCH] Throw more descriptive error on rect read error Gives a bit more context where this error happened. --- common/rfb/DecodeManager.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/rfb/DecodeManager.cxx b/common/rfb/DecodeManager.cxx index 4f60cd59..720aabed 100644 --- a/common/rfb/DecodeManager.cxx +++ b/common/rfb/DecodeManager.cxx @@ -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; -- 2.39.5