Skip to content

Commit

Permalink
[BEAM-8008] show error message from expansion service in Java Externa…
Browse files Browse the repository at this point in the history
…l transform
  • Loading branch information
ihji committed Aug 22, 2019
1 parent eddaf92 commit 744fe67
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.beam.sdk.values.TupleTag;
import org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.ByteString;
import org.apache.beam.vendor.grpc.v1p21p0.io.grpc.ManagedChannelBuilder;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Strings;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterables;

Expand Down Expand Up @@ -186,6 +187,11 @@ public OutputT expand(PInput input) {
ExpansionApi.ExpansionResponse response =
DEFAULT.getExpansionServiceClient(endpoint).expand(request);

if (!Strings.isNullOrEmpty(response.getError())) {
throw new RuntimeException(
String.format("expansion service error: %s", response.getError()));
}

expandedComponents = response.getComponents();
expandedTransform = response.getTransform();

Expand Down

0 comments on commit 744fe67

Please sign in to comment.