Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public ApplicationFailure build() {
details == null ? new EncodedValues(null) : details,
cause,
nextRetryDelay,
category);
category == null ? ApplicationErrorCategory.UNSPECIFIED : category);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,17 @@ private Failure exceptionToFailure(Throwable throwable) {
ApplicationFailureInfo.Builder info =
ApplicationFailureInfo.newBuilder()
.setType(ae.getType())
.setNonRetryable(ae.isNonRetryable())
.setCategory(FailureUtils.categoryToProto(ae.getCategory()));
.setNonRetryable(ae.isNonRetryable());
Optional<Payloads> details = ((EncodedValues) ae.getDetails()).toPayloads();
if (details.isPresent()) {
info.setDetails(details.get());
}
if (ae.getNextRetryDelay() != null) {
info.setNextRetryDelay(ProtobufTimeUtils.toProtoDuration(ae.getNextRetryDelay()));
}
if (ae.getCategory() != null) {
info.setCategory(FailureUtils.categoryToProto(ae.getCategory()));
}
failure.setApplicationFailureInfo(info);
} else if (throwable instanceof TimeoutFailure) {
TimeoutFailure te = (TimeoutFailure) throwable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ public static class TestActivityImpl implements TestActivity {
@Override
public void execute(boolean isBenign) {
if (!isBenign) {
throw ApplicationFailure.newFailure("Non-benign activity failure", "NonBenignType");
throw ApplicationFailure.newBuilder()
.setMessage("Non-benign activity failure")
.setType("NonBenignType")
.build();
} else {
throw ApplicationFailure.newBuilder()
.setMessage("Benign activity failure")
Expand Down
Loading