File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 5
5
6
6
#include < map>
7
7
#include < ostream>
8
- #include < unordered_map>
9
8
#include < unordered_set>
10
9
#include < utility>
11
10
@@ -37,13 +36,39 @@ OPENTELEMETRY_EXPORT bool AttributeIsValidString(nostd::string_view value) noexc
37
36
38
37
OPENTELEMETRY_EXPORT bool AttributeValidator::IsValid (const OwnedAttributeValue &value) noexcept
39
38
{
40
- return nostd::visit (GetSharedAttributeValidator (), value);
39
+ #if OPENTELEMETRY_HAVE_EXCEPTIONS
40
+ try
41
+ {
42
+ #endif
43
+
44
+ return nostd::visit (GetSharedAttributeValidator (), value);
45
+
46
+ #if OPENTELEMETRY_HAVE_EXCEPTIONS
47
+ }
48
+ catch (...)
49
+ {
50
+ return false ;
51
+ }
52
+ #endif
41
53
}
42
54
43
55
OPENTELEMETRY_EXPORT bool AttributeValidator::IsValid (
44
56
const opentelemetry::common::AttributeValue &value) noexcept
45
57
{
46
- return nostd::visit (GetSharedAttributeValidator (), value);
58
+ #if OPENTELEMETRY_HAVE_EXCEPTIONS
59
+ try
60
+ {
61
+ #endif
62
+
63
+ return nostd::visit (GetSharedAttributeValidator (), value);
64
+
65
+ #if OPENTELEMETRY_HAVE_EXCEPTIONS
66
+ }
67
+ catch (...)
68
+ {
69
+ return false ;
70
+ }
71
+ #endif
47
72
}
48
73
49
74
OPENTELEMETRY_EXPORT bool AttributeValidator::IsAllValid (const AttributeMap &attributes) noexcept
Original file line number Diff line number Diff line change 2
2
// SPDX-License-Identifier: Apache-2.0
3
3
4
4
#include < chrono>
5
+ #include < ostream>
5
6
#include < utility>
6
7
7
8
#include " opentelemetry/nostd/function_ref.h"
You can’t perform that action at this time.
0 commit comments