Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use standard c++ exceptions #1853

Merged
merged 11 commits into from
Nov 7, 2024
Merged

Conversation

CendioOssman
Copy link
Member

Clean up our exception handling by using the standard exception classes provided by C++.

Copy link
Member

@samhed samhed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

common/rfb/Exception.h Outdated Show resolved Hide resolved
common/rfb/CSecurityTLS.cxx Show resolved Hide resolved
These seem to always be in ASCII and English, unfortunately, but let's
at least use the API the could give use something more useful.
In preparation for using the built in C++ exception classes, which do
not accept a format string.
In preparation for using the built-in exception types, where the string
can only be set via the constructor.
Harmonize with the standard C++ exceptions.
Make sure our exceptions are part of the standard exception class
hierarchy.
Implicitly gives us the correct exceptions on errors instead of us
having to check and throw ourselves.
Use the more specific already included exception classes for common
errors to keep things more understandable.
Make it easier to identify communication issues.
There is no point to having our own generic exception class. Let's use
the one provided by the standard C++ library.
Make sure the required Windows defines are always available.
This makes things more consistent since we mix with the standard library
exceptions so often.
Copy link
Member

@samhed samhed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@CendioOssman CendioOssman merged commit f7507ae into TigerVNC:master Nov 7, 2024
11 checks passed
@CendioOssman CendioOssman deleted the stdexcept branch November 7, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants