Skip to content

Commit 59f8beb

Browse files
authored
refactor: replace boost::json::error_code with boost::system::error_code (#406)
The latest Boost 1.85 release has deprecated usage of `boost::json::error_code`, and since that causes warnings, our CI fails (since we have warnings-as-errors in CI.) That type was just an alias for `boost::system::error_code`, so I've done a find and replace.
1 parent 1ae6e07 commit 59f8beb

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

libs/client-sdk/src/data_sources/data_source_event_handler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ DataSourceEventHandler::MessageStatus DataSourceEventHandler::HandleMessage(
8585
std::string const& type,
8686
std::string const& data) {
8787
if (type == "put") {
88-
boost::json::error_code error_code;
88+
boost::system::error_code error_code;
8989
auto parsed = boost::json::parse(data, error_code);
9090
if (error_code) {
9191
LD_LOG(logger_, LogLevel::kError) << kErrorParsingPut;
@@ -114,7 +114,7 @@ DataSourceEventHandler::MessageStatus DataSourceEventHandler::HandleMessage(
114114
return MessageStatus::kInvalidMessage;
115115
}
116116
if (type == "patch") {
117-
boost::json::error_code error_code;
117+
boost::system::error_code error_code;
118118
auto parsed = boost::json::parse(data, error_code);
119119
if (error_code) {
120120
LD_LOG(logger_, LogLevel::kError) << kErrorParsingPatch;
@@ -137,7 +137,7 @@ DataSourceEventHandler::MessageStatus DataSourceEventHandler::HandleMessage(
137137
return MessageStatus::kInvalidMessage;
138138
}
139139
if (type == "delete") {
140-
boost::json::error_code error_code;
140+
boost::system::error_code error_code;
141141
auto parsed = boost::json::parse(data, error_code);
142142
if (error_code) {
143143
LD_LOG(logger_, LogLevel::kError) << kErrorParsingDelete;

libs/client-sdk/src/flag_manager/flag_persistence.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void FlagPersistence::LoadCached(Context const& context) {
6565
return;
6666
}
6767

68-
boost::json::error_code error_code;
68+
boost::system::error_code error_code;
6969
auto parsed = boost::json::parse(*data, error_code);
7070
if (error_code) {
7171
LD_LOG(logger_, LogLevel::kError)
@@ -119,7 +119,7 @@ ContextIndex FlagPersistence::GetIndex() {
119119
persistence_->Read(environment_namespace_, index_key_);
120120

121121
if (index_data) {
122-
boost::json::error_code error_code;
122+
boost::system::error_code error_code;
123123
auto parsed = boost::json::parse(*index_data, error_code);
124124
if (error_code) {
125125
LD_LOG(logger_, LogLevel::kError)

libs/client-sdk/tests/context_index_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ TEST(ContextIndexTests, CanSerializeAndDeserialize) {
9999

100100
auto str = boost::json::serialize(boost::json::value_from(context_index));
101101

102-
boost::json::error_code error_code;
102+
boost::system::error_code error_code;
103103
auto parsed = boost::json::parse(str, error_code);
104104
auto deserialized = boost::json::value_to<ContextIndex>(parsed);
105105

libs/internal/src/serialization/json_primitives.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ tl::expected<std::optional<std::uint64_t>, JsonError> tag_invoke(
2626
if (!json_value.is_number()) {
2727
return tl::unexpected(JsonError::kSchemaFailure);
2828
}
29-
boost::json::error_code ec;
29+
boost::system::error_code ec;
3030
auto val = json_value.to_number<uint64_t>(ec);
3131
if (ec) {
3232
return tl::unexpected(JsonError::kSchemaFailure);
@@ -45,7 +45,7 @@ tl::expected<std::optional<std::int64_t>, JsonError> tag_invoke(
4545
if (!json_value.is_number()) {
4646
return tl::unexpected(JsonError::kSchemaFailure);
4747
}
48-
boost::json::error_code ec;
48+
boost::system::error_code ec;
4949
auto val = json_value.to_number<int64_t>(ec);
5050
if (ec) {
5151
return tl::unexpected(JsonError::kSchemaFailure);

libs/server-sdk/src/data_systems/background_sync/sources/polling/polling_data_source.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void PollingDataSource::HandlePollResult(network::HttpResult const& res) {
121121
} else if (res.Status() == 200) {
122122
auto const& body = res.Body();
123123
if (body.has_value()) {
124-
boost::json::error_code error_code;
124+
boost::system::error_code error_code;
125125
auto parsed = boost::json::parse(body.value(), error_code);
126126
if (error_code) {
127127
LD_LOG(logger_, LogLevel::kError) << kErrorParsingPut;

libs/server-sdk/src/data_systems/background_sync/sources/streaming/event_handler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ DataSourceEventHandler::MessageStatus DataSourceEventHandler::HandleMessage(
135135
std::string const& type,
136136
std::string const& data) {
137137
if (type == "put") {
138-
boost::json::error_code error_code;
138+
boost::system::error_code error_code;
139139
auto parsed = boost::json::parse(data, error_code);
140140
if (error_code) {
141141
LD_LOG(logger_, LogLevel::kError) << kErrorParsingPut;
@@ -165,7 +165,7 @@ DataSourceEventHandler::MessageStatus DataSourceEventHandler::HandleMessage(
165165
return MessageStatus::kMessageHandled;
166166
}
167167
if (type == "patch") {
168-
boost::json::error_code error_code;
168+
boost::system::error_code error_code;
169169
auto parsed = boost::json::parse(data, error_code);
170170
if (error_code) {
171171
LD_LOG(logger_, LogLevel::kError) << kErrorParsingPut;
@@ -197,7 +197,7 @@ DataSourceEventHandler::MessageStatus DataSourceEventHandler::HandleMessage(
197197
return MessageStatus::kMessageHandled;
198198
}
199199
if (type == "delete") {
200-
boost::json::error_code error_code;
200+
boost::system::error_code error_code;
201201
auto parsed = boost::json::parse(data, error_code);
202202
if (error_code) {
203203
LD_LOG(logger_, LogLevel::kError) << kErrorParsingDelete;

libs/server-sdk/src/integrations/data_reader/kinds.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace launchdarkly::server_side::integrations {
1010

1111
template <typename TData>
1212
static uint64_t GetVersion(std::string const& data) {
13-
boost::json::error_code error_code;
13+
boost::system::error_code error_code;
1414
auto const parsed = boost::json::parse(data, error_code);
1515

1616
if (error_code) {

0 commit comments

Comments
 (0)