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 55
66#include < map>
77#include < ostream>
8- #include < unordered_map>
98#include < unordered_set>
109#include < utility>
1110
@@ -37,13 +36,39 @@ OPENTELEMETRY_EXPORT bool AttributeIsValidString(nostd::string_view value) noexc
3736
3837OPENTELEMETRY_EXPORT bool AttributeValidator::IsValid (const OwnedAttributeValue &value) noexcept
3938{
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
4153}
4254
4355OPENTELEMETRY_EXPORT bool AttributeValidator::IsValid (
4456 const opentelemetry::common::AttributeValue &value) noexcept
4557{
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
4772}
4873
4974OPENTELEMETRY_EXPORT bool AttributeValidator::IsAllValid (const AttributeMap &attributes) noexcept
Original file line number Diff line number Diff line change 22// SPDX-License-Identifier: Apache-2.0
33
44#include < chrono>
5+ #include < ostream>
56#include < utility>
67
78#include " opentelemetry/nostd/function_ref.h"
You can’t perform that action at this time.
0 commit comments