aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/SConnection.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-09-02 22:58:35 +0200
committerPierre Ossman <ossman@cendio.se>2024-11-06 21:06:27 +0100
commit1d9b2f9984fefbc050c8e3295397ffd280e41788 (patch)
treec6fa8a4f5e0e6fbc0e165c2bd80b2c81a48bf6bc /common/rfb/SConnection.cxx
parent5c3588c464520a4757bfc20974090e21af220cdc (diff)
downloadtigervnc-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/SConnection.cxx')
-rw-r--r--common/rfb/SConnection.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx
index c43ed493..cf9dde05 100644
--- a/common/rfb/SConnection.cxx
+++ b/common/rfb/SConnection.cxx
@@ -95,14 +95,14 @@ bool SConnection::processMsg()
case RFBSTATE_INITIALISATION: return processInitMsg(); break;
case RFBSTATE_NORMAL: return reader_->readMsg(); break;
case RFBSTATE_QUERYING:
- throw Exception("SConnection::processMsg: bogus data from client while "
- "querying");
+ throw std::logic_error("SConnection::processMsg: bogus data from "
+ "client while querying");
case RFBSTATE_CLOSING:
- throw Exception("SConnection::processMsg: called while closing");
+ throw std::logic_error("SConnection::processMsg: called while closing");
case RFBSTATE_UNINITIALISED:
- throw Exception("SConnection::processMsg: not initialised yet?");
+ throw std::logic_error("SConnection::processMsg: not initialised yet?");
default:
- throw Exception("SConnection::processMsg: invalid state");
+ throw std::logic_error("SConnection::processMsg: invalid state");
}
}
@@ -336,7 +336,7 @@ void SConnection::setAccessRights(AccessRights ar)
bool SConnection::accessCheck(AccessRights ar) const
{
if (state_ < RFBSTATE_QUERYING)
- throw Exception("SConnection::accessCheck: invalid state");
+ throw std::logic_error("SConnection::accessCheck: invalid state");
return (accessRights & ar) == ar;
}
@@ -449,7 +449,7 @@ void SConnection::queryConnection(const char* /*userName*/)
void SConnection::approveConnection(bool accept, const char* reason)
{
if (state_ != RFBSTATE_QUERYING)
- throw Exception("SConnection::approveConnection: invalid state");
+ throw std::logic_error("SConnection::approveConnection: invalid state");
if (!client.beforeVersion(3,8) || ssecurity->getType() != secTypeNone) {
if (accept) {