Skip to content

Commit 4072389

Browse files
authored
Don't fill/clear response if error is filled (#4447)
1 parent a421b6d commit 4072389

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ydb/core/fq/libs/cloud_audit/yq_cloud_audit_service.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,16 @@ void FillResponse(TEvent& cloudEvent, const NYql::TIssues& issues) {
131131
cloudEvent.set_event_status(issues.Empty()
132132
? yandex::cloud::events::EventStatus::DONE
133133
: yandex::cloud::events::EventStatus::ERROR);
134-
135-
// response field must always be filled
136-
cloudEvent.mutable_response();
137-
134+
135+
// response and error fields are mutually exclusive
136+
// exactly one of them is required
138137
if (issues) {
138+
cloudEvent.clear_response();
139139
auto* error = cloudEvent.mutable_error();
140140
error->set_code(grpc::StatusCode::UNKNOWN);
141141
error->set_message(issues.ToString());
142+
} else {
143+
cloudEvent.mutable_response();
142144
}
143145
}
144146

0 commit comments

Comments
 (0)