-
Notifications
You must be signed in to change notification settings - Fork 861
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
Added proper error handling around sync resources #1393
Conversation
CodeFactor to ignore: Complex code in api.cpp. |
{ | ||
gp = &newGroup(gtp); | ||
} | ||
catch (...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for any certain exception or any?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably only system exceptions and those freshly added here (although "added" is only in order to comply with the C++ std version).
@@ -2827,7 +2843,7 @@ SRTSOCKET CUDT::createGroup(SRT_GROUP_TYPE gt) | |||
{ | |||
return APIError(e); | |||
} | |||
catch (const std::bad_alloc& e) | |||
catch (...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why bad_alock
was not enough there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There could be some other types of exceptions thrown from the C++ standard library, as I remember. All of them qualify as IPE or at best lethal state of the system resources.
Fixes #1104
This adds error handling around sync resources. It's a shortcut for #1379 with only a fragment embracing the error handling.