Skip to content

Commit

Permalink
Prefix InterruptedCode's UNSPECIFIED with the enum name
Browse files Browse the repository at this point in the history
It's a best practice because in C++ all protobuf enum values under a
message share one namespace.

RELNOTES: None.
PiperOrigin-RevId: 294742246
  • Loading branch information
anakanemison authored and copybara-github committed Feb 12, 2020
1 parent 2572bba commit 636430a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ private void executeCommand(RunRequest request, BlockingStreamObserver<RunRespon
} catch (InterruptedException e) {
result =
BlazeCommandResult.failureDetail(
FailureDetailUtil.interrupted(InterruptedCode.UNSPECIFIED));
FailureDetailUtil.interrupted(InterruptedCode.INTERRUPTED_UNSPECIFIED));
commandId = ""; // The default value, the client will ignore it
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/protobuf/failure_details.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ message FailureDetail {
message Interrupted {
enum InterruptedCode {
// Interrupted at an unspecified time.
UNSPECIFIED = 0 [(metadata) = { exit_code: 8 }];
INTERRUPTED_UNSPECIFIED = 0 [(metadata) = { exit_code: 8 }];
// TODO(mschaller): Add subcategories that specify what was happening at the
// time of interruption.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ public void onCompleted() {
assertThat(secondResponse.get().hasFailureDetail()).isTrue();
assertThat(secondResponse.get().getFailureDetail().hasInterrupted()).isTrue();
assertThat(secondResponse.get().getFailureDetail().getInterrupted().getCode())
.isEqualTo(InterruptedCode.UNSPECIFIED);
.isEqualTo(InterruptedCode.INTERRUPTED_UNSPECIFIED);
}

@Test
Expand Down

0 comments on commit 636430a

Please sign in to comment.