-
Notifications
You must be signed in to change notification settings - Fork 546
[CODE HEALTH] Fix clang-tidy bugprone-exception-escape warnings in API #3964
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
base: main
Are you sure you want to change the base?
Changes from all commits
de63dc9
b3fb6d2
b3e5740
0b6d984
6090ef9
0a9c076
c76e6d4
5f3d5ee
79eed4e
fe2da7e
b511dbe
db192e0
a1253df
6105492
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,36 +3,34 @@ | |
|
|
||
| #pragma once | ||
|
|
||
| #if __EXCEPTIONS | ||
| # include <new> | ||
| #endif // __EXCEPTIONS | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace plugin | ||
| { | ||
| namespace detail | ||
| { | ||
| inline void CopyErrorMessage(const char *source, std::string &destination) noexcept | ||
| #if __EXCEPTIONS | ||
| try | ||
| #endif | ||
| { | ||
| if (source == nullptr) | ||
| #if OPENTELEMETRY_HAVE_EXCEPTIONS | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The It should be possible to relax this method to not be noexcept, if it makes the code simpler. Beside, but this is a separate discussion, I think the whole plugin part should be deprecated and removed from the code base, so it it ok to leave and silence clang-tidy messages in the mean time. |
||
| try | ||
| #endif | ||
| { | ||
| if (source == nullptr) | ||
| { | ||
| return; | ||
| } | ||
| destination.assign(source); | ||
| } | ||
| #if OPENTELEMETRY_HAVE_EXCEPTIONS | ||
| catch (...) | ||
| { | ||
| return; | ||
| } | ||
| destination.assign(source); | ||
| } | ||
| #if __EXCEPTIONS | ||
| catch (const std::bad_alloc &) | ||
| { | ||
| return; | ||
| } | ||
| #endif | ||
| } | ||
| } // namespace detail | ||
| } // namespace plugin | ||
| OPENTELEMETRY_END_NAMESPACE | ||
Uh oh!
There was an error while loading. Please reload this page.