Skip to content

Commit

Permalink
kv error context: do not render zero opaque and retry attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
avsej committed May 22, 2023
1 parent 5c21997 commit a7d8c0f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/impl/key_value_error_context.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ key_value_error_context::to_json() const -> std::string
{ "bucket", bucket_ },
{ "scope", scope_ },
{ "collection", collection_ },
{ "opaque", opaque_ },
{ "retry_attempts", retry_attempts() },
};

if (auto val = retry_attempts(); val > 0) {
json["retry_attempts"] = val;
}
if (opaque_ > 0) {
json["opaque"] = opaque_;
}

if (!cas_.empty()) {
json["cas"] = fmt::format("{}", cas_);
}
Expand Down

0 comments on commit a7d8c0f

Please sign in to comment.