summaryrefslogtreecommitdiffstats
path: root/common/rfb/CConnection.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2017-10-12 15:05:07 +0200
committerPierre Ossman <ossman@cendio.se>2017-10-12 15:05:07 +0200
commit19225507cca088ff965ccfc91bcf6f1fcd9960b3 (patch)
tree5b9f9462cdf9f6dec8c81f4569f73be5be023758 /common/rfb/CConnection.cxx
parentae7c2002d0f92fe84d204137461e91b4d1b70ca3 (diff)
downloadtigervnc-19225507cca088ff965ccfc91bcf6f1fcd9960b3.tar.gz
tigervnc-19225507cca088ff965ccfc91bcf6f1fcd9960b3.zip
Make exception classes have clearer messages
Include the type of exception in the string generated by each subclass. Also simplify the constructs to what is needed.
Diffstat (limited to 'common/rfb/CConnection.cxx')
-rw-r--r--common/rfb/CConnection.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx
index 88befd5e..ce489b1b 100644
--- a/common/rfb/CConnection.cxx
+++ b/common/rfb/CConnection.cxx
@@ -270,12 +270,10 @@ void CConnection::processSecurityResultMsg()
default:
throw Exception("Unknown security result from server");
}
- CharArray reason;
- if (cp.beforeVersion(3,8))
- reason.buf = strDup("Authentication failure");
- else
- reason.buf = is->readString();
state_ = RFBSTATE_INVALID;
+ if (cp.beforeVersion(3,8))
+ throw AuthFailureException();
+ CharArray reason(is->readString());
throw AuthFailureException(reason.buf);
}