diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-09-02 17:03:10 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-11-06 21:06:27 +0100 |
commit | f25de739ea359c2843a596457bcd22a28175b7a4 (patch) | |
tree | ae7bed3ed0d7e61938922540c7abdafbaa7e8938 /win | |
parent | bdeaeebd48ad39898b804e0083ed1456cc64f24b (diff) | |
download | tigervnc-f25de739ea359c2843a596457bcd22a28175b7a4.tar.gz tigervnc-f25de739ea359c2843a596457bcd22a28175b7a4.zip |
Use what() to access exception description
Harmonize with the standard C++ exceptions.
Diffstat (limited to 'win')
-rw-r--r-- | win/rfb_win32/CleanDesktop.cxx | 12 | ||||
-rw-r--r-- | win/rfb_win32/Clipboard.cxx | 2 | ||||
-rw-r--r-- | win/rfb_win32/DeviceFrameBuffer.cxx | 2 | ||||
-rw-r--r-- | win/rfb_win32/MsgWindow.cxx | 2 | ||||
-rw-r--r-- | win/rfb_win32/RegConfig.cxx | 4 | ||||
-rw-r--r-- | win/rfb_win32/SDisplay.cxx | 6 | ||||
-rw-r--r-- | win/rfb_win32/SocketManager.cxx | 4 | ||||
-rw-r--r-- | win/vncconfig/Connections.h | 2 | ||||
-rw-r--r-- | win/vncconfig/Legacy.cxx | 6 | ||||
-rw-r--r-- | win/vncconfig/vncconfig.cxx | 2 | ||||
-rw-r--r-- | win/winvnc/ManagedListener.cxx | 2 | ||||
-rw-r--r-- | win/winvnc/STrayIcon.cxx | 2 | ||||
-rw-r--r-- | win/winvnc/VNCServerWin32.cxx | 4 | ||||
-rw-r--r-- | win/winvnc/winvnc.cxx | 4 |
14 files changed, 27 insertions, 27 deletions
diff --git a/win/rfb_win32/CleanDesktop.cxx b/win/rfb_win32/CleanDesktop.cxx index 6d933b22..8e0b70bc 100644 --- a/win/rfb_win32/CleanDesktop.cxx +++ b/win/rfb_win32/CleanDesktop.cxx @@ -174,7 +174,7 @@ void CleanDesktop::disableWallpaper() { if (ad.enable(false)) restoreActiveDesktop = true; } catch (rdr::Exception& e) { - vlog.error("%s", e.str()); + vlog.error("%s", e.what()); } // -=- Switch of normal wallpaper and notify apps @@ -182,7 +182,7 @@ void CleanDesktop::disableWallpaper() { restoreWallpaper = true; } catch (rdr::Exception& e) { - vlog.info("%s", e.str()); + vlog.info("%s", e.what()); } } @@ -199,7 +199,7 @@ void CleanDesktop::enableWallpaper() { ad.enable(true); restoreActiveDesktop = false; } catch (rdr::Exception& e) { - vlog.error("%s", e.str()); + vlog.error("%s", e.what()); } } @@ -212,7 +212,7 @@ void CleanDesktop::enableWallpaper() { } } catch (rdr::Exception& e) { - vlog.info("%s", e.str()); + vlog.info("%s", e.what()); } } @@ -244,7 +244,7 @@ void CleanDesktop::disableEffects() { restoreEffects = true; } catch (rdr::Exception& e) { - vlog.info("%s", e.str()); + vlog.info("%s", e.what()); } } @@ -269,6 +269,6 @@ void CleanDesktop::enableEffects() { } } catch (rdr::Exception& e) { - vlog.info("%s", e.str()); + vlog.info("%s", e.what()); } } diff --git a/win/rfb_win32/Clipboard.cxx b/win/rfb_win32/Clipboard.cxx index 242ebf34..5a3e3aba 100644 --- a/win/rfb_win32/Clipboard.cxx +++ b/win/rfb_win32/Clipboard.cxx @@ -151,7 +151,7 @@ Clipboard::setClipText(const char* text) { vlog.debug("set clipboard"); } catch (rdr::Exception& e) { - vlog.debug("%s", e.str()); + vlog.debug("%s", e.what()); } // - Close the clipboard diff --git a/win/rfb_win32/DeviceFrameBuffer.cxx b/win/rfb_win32/DeviceFrameBuffer.cxx index ca2f57d4..2cf8adae 100644 --- a/win/rfb_win32/DeviceFrameBuffer.cxx +++ b/win/rfb_win32/DeviceFrameBuffer.cxx @@ -309,6 +309,6 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server) server->setCursor(width, height, hotspot, buffer.data()); } catch (rdr::Exception& e) { - vlog.error("%s", e.str()); + vlog.error("%s", e.what()); } } diff --git a/win/rfb_win32/MsgWindow.cxx b/win/rfb_win32/MsgWindow.cxx index e94b60a8..25d8ee2c 100644 --- a/win/rfb_win32/MsgWindow.cxx +++ b/win/rfb_win32/MsgWindow.cxx @@ -62,7 +62,7 @@ LRESULT CALLBACK MsgWindowProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) try { result = _this->processMessage(msg, wParam, lParam); } catch (rdr::Exception& e) { - vlog.error("untrapped: %s", e.str()); + vlog.error("untrapped: %s", e.what()); } return result; diff --git a/win/rfb_win32/RegConfig.cxx b/win/rfb_win32/RegConfig.cxx index fc006b21..e4ad5be5 100644 --- a/win/rfb_win32/RegConfig.cxx +++ b/win/rfb_win32/RegConfig.cxx @@ -54,7 +54,7 @@ bool RegConfig::setKey(const HKEY rootkey, const char* keyname) { processEvent(event); return true; } catch (rdr::Exception& e) { - vlog.debug("%s", e.str()); + vlog.debug("%s", e.what()); return false; } } @@ -71,7 +71,7 @@ void RegConfig::loadRegistryConfig(RegKey& key) { } } catch (rdr::Win32Exception& e) { if (e.err != ERROR_INVALID_HANDLE) - vlog.error("%s", e.str()); + vlog.error("%s", e.what()); } } diff --git a/win/rfb_win32/SDisplay.cxx b/win/rfb_win32/SDisplay.cxx index 0ec5e231..ea64dbe9 100644 --- a/win/rfb_win32/SDisplay.cxx +++ b/win/rfb_win32/SDisplay.cxx @@ -202,7 +202,7 @@ void SDisplay::startCore() { if (tryMethod == 0) throw rdr::Exception("unable to access desktop"); tryMethod--; - vlog.error("%s", e.str()); + vlog.error("%s", e.what()); } } vlog.info("Started %s", core->methodName()); @@ -292,7 +292,7 @@ void SDisplay::restartCore() { // to cause the server to stop() the desktop. // Otherwise, the SDesktop is in an inconsistent state // and the server will crash. - server->closeClients(e.str()); + server->closeClients(e.what()); } } @@ -401,7 +401,7 @@ SDisplay::processEvent(HANDLE event) { try { core->flushUpdates(); } catch (rdr::Exception& e) { - vlog.error("%s", e.str()); + vlog.error("%s", e.what()); restartCore(); return; } diff --git a/win/rfb_win32/SocketManager.cxx b/win/rfb_win32/SocketManager.cxx index 2bc2f53e..cdc65409 100644 --- a/win/rfb_win32/SocketManager.cxx +++ b/win/rfb_win32/SocketManager.cxx @@ -80,7 +80,7 @@ void SocketManager::addListener(network::SocketListener* sock_, if (event) WSACloseEvent(event); delete sock_; - vlog.error("%s", e.str()); + vlog.error("%s", e.what()); throw; } @@ -268,7 +268,7 @@ void SocketManager::processEvent(HANDLE event) { if (WSAEventSelect(ci.sock->getFd(), event, eventMask) == SOCKET_ERROR) throw rdr::SocketException("unable to re-enable WSAEventSelect:%u", WSAGetLastError()); } catch (rdr::Exception& e) { - vlog.error("%s", e.str()); + vlog.error("%s", e.what()); remSocket(ci.sock); } } diff --git a/win/vncconfig/Connections.h b/win/vncconfig/Connections.h index a540bd76..8c8bb9aa 100644 --- a/win/vncconfig/Connections.h +++ b/win/vncconfig/Connections.h @@ -74,7 +74,7 @@ namespace rfb { network::TcpFilter::Pattern pat(network::TcpFilter::parsePattern(newPat.c_str())); pattern = network::TcpFilter::patternToStr(pat); } catch(rdr::Exception& e) { - MsgBox(nullptr, e.str(), MB_ICONEXCLAMATION | MB_OK); + MsgBox(nullptr, e.what(), MB_ICONEXCLAMATION | MB_OK); return false; } return true; diff --git a/win/vncconfig/Legacy.cxx b/win/vncconfig/Legacy.cxx index 9300bb05..3dae1c99 100644 --- a/win/vncconfig/Legacy.cxx +++ b/win/vncconfig/Legacy.cxx @@ -146,7 +146,7 @@ void LegacyPage::LoadPrefs() vlog.info("loading Default prefs"); LoadUserPrefs(userKey); } catch(rdr::Exception& e) { - vlog.error("error reading Default settings:%s", e.str()); + vlog.error("error reading Default settings:%s", e.what()); } // Open the local, user-specific settings @@ -157,7 +157,7 @@ void LegacyPage::LoadPrefs() vlog.info("loading local User prefs"); LoadUserPrefs(userKey); } catch(rdr::Exception& e) { - vlog.error("error reading local User settings:%s", e.str()); + vlog.error("error reading local User settings:%s", e.what()); } // Open the user's own settings @@ -168,7 +168,7 @@ void LegacyPage::LoadPrefs() vlog.info("loading global User prefs"); LoadUserPrefs(userKey); } catch(rdr::Exception& e) { - vlog.error("error reading global User settings:%s", e.str()); + vlog.error("error reading global User settings:%s", e.what()); } } } diff --git a/win/vncconfig/vncconfig.cxx b/win/vncconfig/vncconfig.cxx index 55f01d2e..bfe4e640 100644 --- a/win/vncconfig/vncconfig.cxx +++ b/win/vncconfig/vncconfig.cxx @@ -180,7 +180,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE /*prev*/, char* /*cmdLine*/, int /* } } catch (rdr::Exception& e) { - MsgBox(nullptr, e.str(), MB_ICONEXCLAMATION | MB_OK); + MsgBox(nullptr, e.what(), MB_ICONEXCLAMATION | MB_OK); return 1; } diff --git a/win/winvnc/ManagedListener.cxx b/win/winvnc/ManagedListener.cxx index adc074cf..43fe863a 100644 --- a/win/winvnc/ManagedListener.cxx +++ b/win/winvnc/ManagedListener.cxx @@ -101,7 +101,7 @@ void ManagedListener::refresh() { network::createTcpListeners(&sockets, nullptr, port); } } catch (rdr::Exception& e) { - vlog.error("%s", e.str()); + vlog.error("%s", e.what()); } if (!sockets.empty()) { if (!localOnly) { diff --git a/win/winvnc/STrayIcon.cxx b/win/winvnc/STrayIcon.cxx index d703f47a..3dbe2c81 100644 --- a/win/winvnc/STrayIcon.cxx +++ b/win/winvnc/STrayIcon.cxx @@ -160,7 +160,7 @@ public: try { rfb::win32::stopService(VNCServerService::Name); } catch (rdr::Exception& e) { - MsgBox(nullptr, e.str(), MB_ICONERROR | MB_OK); + MsgBox(nullptr, e.what(), MB_ICONERROR | MB_OK); } } else { thread.server.stop(); diff --git a/win/winvnc/VNCServerWin32.cxx b/win/winvnc/VNCServerWin32.cxx index c1545ab6..9d722740 100644 --- a/win/winvnc/VNCServerWin32.cxx +++ b/win/winvnc/VNCServerWin32.cxx @@ -197,10 +197,10 @@ int VNCServerWin32::run() { vlog.debug("Server exited cleanly"); } catch (rdr::Win32Exception &s) { - vlog.error("%s", s.str()); + vlog.error("%s", s.what()); result = s.err; } catch (rdr::Exception &e) { - vlog.error("%s", e.str()); + vlog.error("%s", e.what()); } { diff --git a/win/winvnc/winvnc.cxx b/win/winvnc/winvnc.cxx index ceee0c6f..e6f8abe7 100644 --- a/win/winvnc/winvnc.cxx +++ b/win/winvnc/winvnc.cxx @@ -229,7 +229,7 @@ static void processParams(int argc, char** argv) { } } catch (rdr::Exception& e) { - MsgBoxOrLog(e.str(), true); + MsgBoxOrLog(e.what(), true); } } } @@ -285,7 +285,7 @@ int WINAPI WinMain(HINSTANCE /*inst*/, HINSTANCE /*prevInst*/, char* /*cmdLine*/ vlog.debug("WinVNC service destroyed"); } catch (rdr::Exception& e) { - MsgBoxOrLog(e.str(), true); + MsgBoxOrLog(e.what(), true); } vlog.debug("WinVNC process quitting"); |