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/Security.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'win/rfb_win32/Security.cxx') diff --git a/win/rfb_win32/Security.cxx b/win/rfb_win32/Security.cxx index 04f92402..65153732 100644 --- a/win/rfb_win32/Security.cxx +++ b/win/rfb_win32/Security.cxx @@ -96,7 +96,7 @@ void AccessEntries::addEntry(const PSID sid, PSID Sid::copySID(const PSID sid) { if (!IsValidSid(sid)) - throw rdr::Exception("invalid SID in copyPSID"); + throw std::invalid_argument("invalid SID in copyPSID"); PSID buf = (PSID)new uint8_t[GetLengthSid(sid)]; if (!CopySid(GetLengthSid(sid), buf, sid)) throw rdr::Win32Exception("CopySid failed", GetLastError()); @@ -105,7 +105,7 @@ PSID Sid::copySID(const PSID sid) { void Sid::setSID(const PSID sid) { if (!IsValidSid(sid)) - throw rdr::Exception("invalid SID in copyPSID"); + throw std::invalid_argument("invalid SID in copyPSID"); resize(GetLengthSid(sid)); if (!CopySid(GetLengthSid(sid), data(), sid)) throw rdr::Win32Exception("CopySid failed", GetLastError()); -- cgit v1.2.3