diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-09-02 22:58:35 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-11-06 21:06:27 +0100 |
commit | 1d9b2f9984fefbc050c8e3295397ffd280e41788 (patch) | |
tree | c6fa8a4f5e0e6fbc0e165c2bd80b2c81a48bf6bc /common/rdr/BufferedInStream.cxx | |
parent | 5c3588c464520a4757bfc20974090e21af220cdc (diff) | |
download | tigervnc-1d9b2f9984fefbc050c8e3295397ffd280e41788.tar.gz tigervnc-1d9b2f9984fefbc050c8e3295397ffd280e41788.zip |
Use standard exception classes
Use the more specific already included exception classes for common
errors to keep things more understandable.
Diffstat (limited to 'common/rdr/BufferedInStream.cxx')
-rw-r--r-- | common/rdr/BufferedInStream.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/common/rdr/BufferedInStream.cxx b/common/rdr/BufferedInStream.cxx index 204202ec..bf94a950 100644 --- a/common/rdr/BufferedInStream.cxx +++ b/common/rdr/BufferedInStream.cxx @@ -24,7 +24,6 @@ #include <assert.h> #include <rdr/BufferedInStream.h> -#include <rdr/Exception.h> #include <rfb/util.h> @@ -65,10 +64,12 @@ void BufferedInStream::ensureSpace(size_t needed) uint8_t* newBuffer; if (needed > MAX_BUF_SIZE) - throw Exception(rfb::format("BufferedInStream overrun: requested " - "size of %lu bytes exceeds maximum " - "of %lu bytes", (long unsigned)needed, - (long unsigned)MAX_BUF_SIZE)); + throw std::out_of_range(rfb::format("BufferedInStream overrun: " + "requested size of %lu bytes " + "exceeds maximum of %lu " + "bytes", + (long unsigned)needed, + (long unsigned)MAX_BUF_SIZE)); newSize = DEFAULT_BUF_SIZE; while (newSize < needed) |