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/rfb/ClientParams.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/rfb/ClientParams.cxx')
-rw-r--r-- | common/rfb/ClientParams.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/common/rfb/ClientParams.cxx b/common/rfb/ClientParams.cxx index 3f80f109..495b4bd1 100644 --- a/common/rfb/ClientParams.cxx +++ b/common/rfb/ClientParams.cxx @@ -22,7 +22,8 @@ #include <config.h> #endif -#include <rfb/Exception.h> +#include <stdexcept> + #include <rfb/encodings.h> #include <rfb/ledStates.h> #include <rfb/clipboardTypes.h> @@ -63,7 +64,7 @@ void ClientParams::setDimensions(int width, int height) void ClientParams::setDimensions(int width, int height, const ScreenSet& layout) { if (!layout.validate(width, height)) - throw Exception("Attempted to configure an invalid screen layout"); + throw std::invalid_argument("Attempted to configure an invalid screen layout"); width_ = width; height_ = height; @@ -75,7 +76,7 @@ void ClientParams::setPF(const PixelFormat& pf) pf_ = pf; if (pf.bpp != 8 && pf.bpp != 16 && pf.bpp != 32) - throw Exception("setPF: not 8, 16 or 32 bpp?"); + throw std::invalid_argument("setPF: not 8, 16 or 32 bpp?"); } void ClientParams::setName(const char* name) @@ -161,7 +162,7 @@ uint32_t ClientParams::clipboardSize(unsigned int format) const return clipSizes[i]; } - throw Exception(rfb::format("Invalid clipboard format 0x%x", format)); + throw std::invalid_argument(rfb::format("Invalid clipboard format 0x%x", format)); } void ClientParams::setClipboardCaps(uint32_t flags, const uint32_t* lengths) |