diff options
Diffstat (limited to 'common/rdr/InStream.h')
-rw-r--r-- | common/rdr/InStream.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/common/rdr/InStream.h b/common/rdr/InStream.h index 939439e1..5623142c 100644 --- a/common/rdr/InStream.h +++ b/common/rdr/InStream.h @@ -28,7 +28,7 @@ #include <stdint.h> #include <string.h> // for memcpy -#include <rdr/Exception.h> +#include <stdexcept> // Check that callers are using InStream properly, // useful when writing new protocol handling @@ -101,21 +101,21 @@ namespace rdr { inline void setRestorePoint() { #ifdef RFB_INSTREAM_CHECK if (restorePoint != nullptr) - throw Exception("Nested use of input stream restore point"); + throw std::logic_error("Nested use of input stream restore point"); #endif restorePoint = ptr; } inline void clearRestorePoint() { #ifdef RFB_INSTREAM_CHECK if (restorePoint == nullptr) - throw Exception("Incorrect clearing of input stream restore point"); + throw std::logic_error("Incorrect clearing of input stream restore point"); #endif restorePoint = nullptr; } inline void gotoRestorePoint() { #ifdef RFB_INSTREAM_CHECK if (restorePoint == nullptr) - throw Exception("Incorrect activation of input stream restore point"); + throw std::logic_error("Incorrect activation of input stream restore point"); #endif ptr = restorePoint; clearRestorePoint(); @@ -176,7 +176,7 @@ namespace rdr { inline const uint8_t* getptr(size_t length) { check(length); return ptr; } inline void setptr(size_t length) { if (length > avail()) - throw Exception("Input stream overflow"); + throw std::out_of_range("Input stream overflow"); skip(length); } private: @@ -189,11 +189,11 @@ namespace rdr { inline void check(size_t bytes) { #ifdef RFB_INSTREAM_CHECK if (bytes > checkedBytes) - throw Exception("Input stream used without underrun check"); + throw std::logic_error("Input stream used without underrun check"); checkedBytes -= bytes; #endif if (bytes > (size_t)(end - ptr)) - throw Exception("InStream buffer underrun"); + throw std::out_of_range("InStream buffer underrun"); } // overrun() is implemented by a derived class to cope with buffer overrun. |