Skip to content

Commit

Permalink
Set correct MessageToString return value
Browse files Browse the repository at this point in the history
Signed-off-by: jakub-racek-swi <jakub.racek@solarwinds.com>
  • Loading branch information
jakub-racek-swi committed Sep 17, 2024
1 parent fe2bbaf commit 79ff0cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion otlp/otlp_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ template <typename T> std::string get_request_json(const T &request)
google::protobuf::util::JsonPrintOptions json_print_options;
json_print_options.add_whitespace = true;
json_print_options.always_print_primitive_fields = true;
google::protobuf::util::Status status = google::protobuf::util::MessageToJsonString(request, &request_json_str, json_print_options);
auto status = google::protobuf::util::MessageToJsonString(request, &request_json_str, json_print_options);
if (!status.ok()) {
std::cerr << "Failed to convert message to JSON: " << status.ToString() << std::endl;
return "";
Expand Down

0 comments on commit 79ff0cd

Please sign in to comment.