From 1d9b2f9984fefbc050c8e3295397ffd280e41788 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 2 Sep 2024 22:58:35 +0200 Subject: Use standard exception classes Use the more specific already included exception classes for common errors to keep things more understandable. --- win/rfb_win32/DIBSectionBuffer.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'win/rfb_win32/DIBSectionBuffer.cxx') diff --git a/win/rfb_win32/DIBSectionBuffer.cxx b/win/rfb_win32/DIBSectionBuffer.cxx index ca6f3c9a..62b917c0 100644 --- a/win/rfb_win32/DIBSectionBuffer.cxx +++ b/win/rfb_win32/DIBSectionBuffer.cxx @@ -56,7 +56,7 @@ void DIBSectionBuffer::initBuffer(const PixelFormat& pf, int w, int h) { uint8_t* new_data = nullptr; if (!pf.trueColour) - throw rfb::Exception("palette format not supported"); + throw std::invalid_argument("palette format not supported"); format = pf; @@ -158,7 +158,7 @@ void DIBSectionBuffer::initBuffer(const PixelFormat& pf, int w, int h) { bits = bits >> 1; } if (depth > bpp) - throw Exception("Bad DIBSection format (depth exceeds bpp)"); + throw std::runtime_error("Bad DIBSection format (depth exceeds bpp)"); format = PixelFormat(bpp, depth, false, true, redMax, greenMax, blueMax, -- cgit v1.2.3