diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-11-25 20:37:56 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-11-26 10:10:31 +0100 |
commit | 0947e097b1ef9feb4250eae071ac6ad7ffa7f14d (patch) | |
tree | ced07da074aee6af79e1b79f2e3ed67e5efcaa88 /common/rdr/Exception.cxx | |
parent | 5c14cd9f7ca1aeb19a7a69ab44e94f025ad39bf4 (diff) | |
download | tigervnc-0947e097b1ef9feb4250eae071ac6ad7ffa7f14d.tar.gz tigervnc-0947e097b1ef9feb4250eae071ac6ad7ffa7f14d.zip |
Mark all exception type methods as noexcept
This is required for the built in exceptions, so let's do the same to
avoid surprises.
Diffstat (limited to 'common/rdr/Exception.cxx')
-rw-r--r-- | common/rdr/Exception.cxx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/common/rdr/Exception.cxx b/common/rdr/Exception.cxx index 694ee359..f0c04a6a 100644 --- a/common/rdr/Exception.cxx +++ b/common/rdr/Exception.cxx @@ -43,21 +43,22 @@ using namespace rdr; -getaddrinfo_error::getaddrinfo_error(const char* s, int err_) +getaddrinfo_error::getaddrinfo_error(const char* s, int err_) noexcept : std::runtime_error(rfb::format("%s: %s (%d)", s, strerror(err_).c_str(), err_)), err(err_) { } -getaddrinfo_error::getaddrinfo_error(const std::string& s, int err_) +getaddrinfo_error::getaddrinfo_error(const std::string& s, + int err_) noexcept : std::runtime_error(rfb::format("%s: %s (%d)", s.c_str(), strerror(err_).c_str(), err_)), err(err_) { } -std::string getaddrinfo_error::strerror(int err_) const +std::string getaddrinfo_error::strerror(int err_) const noexcept { #ifdef _WIN32 char str[256]; @@ -71,21 +72,21 @@ std::string getaddrinfo_error::strerror(int err_) const #endif } -posix_error::posix_error(const char* what_arg, int err_) +posix_error::posix_error(const char* what_arg, int err_) noexcept : std::runtime_error(rfb::format("%s: %s (%d)", what_arg, strerror(err_).c_str(), err_)), err(err_) { } -posix_error::posix_error(const std::string& what_arg, int err_) +posix_error::posix_error(const std::string& what_arg, int err_) noexcept : std::runtime_error(rfb::format("%s: %s (%d)", what_arg.c_str(), strerror(err_).c_str(), err_)), err(err_) { } -std::string posix_error::strerror(int err_) const +std::string posix_error::strerror(int err_) const noexcept { #ifdef _WIN32 char str[256]; @@ -100,21 +101,22 @@ std::string posix_error::strerror(int err_) const } #ifdef WIN32 -win32_error::win32_error(const char* what_arg, unsigned err_) +win32_error::win32_error(const char* what_arg, unsigned err_) noexcept : std::runtime_error(rfb::format("%s: %s (%d)", what_arg, strerror(err_).c_str(), err_)), err(err_) { } -win32_error::win32_error(const std::string& what_arg, unsigned err_) +win32_error::win32_error(const std::string& what_arg, + unsigned err_) noexcept : std::runtime_error(rfb::format("%s: %s (%d)", what_arg.c_str(), strerror(err_).c_str(), err_)), err(err_) { } -std::string win32_error::strerror(unsigned err_) const +std::string win32_error::strerror(unsigned err_) const noexcept { wchar_t wstr[256]; char str[256]; |