diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-09-03 09:10:14 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-09-04 12:52:53 +0200 |
commit | 0e272178d1887b0ef0ccac61876c6f5e30fea22f (patch) | |
tree | a30f5b4c2b069accc0eafb3d4f9c1ee1f549c8ad /vncviewer/UserDialog.cxx | |
parent | 2d5636e8c8dca77c0c52924eb931a79ccf731911 (diff) | |
download | tigervnc-0e272178d1887b0ef0ccac61876c6f5e30fea22f.tar.gz tigervnc-0e272178d1887b0ef0ccac61876c6f5e30fea22f.zip |
Add more usage of SystemException
Prefer this exception for failures involving errno as it gives a better
error description.
Diffstat (limited to 'vncviewer/UserDialog.cxx')
-rw-r--r-- | vncviewer/UserDialog.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vncviewer/UserDialog.cxx b/vncviewer/UserDialog.cxx index 13821a9c..6ea67d6d 100644 --- a/vncviewer/UserDialog.cxx +++ b/vncviewer/UserDialog.cxx @@ -21,6 +21,7 @@ #endif #include <assert.h> +#include <errno.h> #include <stdio.h> #include <string.h> @@ -114,7 +115,7 @@ void UserDialog::getUserPasswd(bool secure_, std::string* user, fp = fopen(passwordFileName, "rb"); if (!fp) - throw rfb::Exception(_("Opening password file failed")); + throw rdr::SystemException(_("Opening password file failed"), errno); obfPwd.resize(fread(obfPwd.data(), 1, obfPwd.size(), fp)); fclose(fp); |