Skip to content

Commit b3b00c8

Browse files
committed
added execution failure detection
1 parent 249fc7c commit b3b00c8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

base/src/com/google/idea/blaze/base/dependencies/BlazeQueryDirectoryToTargetProvider.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.google.idea.blaze.base.scope.BlazeContext;
2929
import com.google.idea.blaze.base.sync.projectview.ImportRoots;
3030
import com.google.idea.blaze.base.sync.workspace.WorkspacePathResolver;
31+
import com.google.idea.blaze.exception.BuildException;
3132
import com.intellij.execution.ExecutionException;
3233
import com.intellij.openapi.diagnostic.Logger;
3334
import com.intellij.openapi.project.Project;
@@ -88,14 +89,16 @@ private static ImmutableList<TargetInfo> runQuery(Project project, String query,
8889

8990
final var outputProcessor = new BlazeQueryLabelKindParser(t -> true);
9091
try (final var result = BazelExecService.of(project).exec(context, command)) {
92+
result.throwOnFailure();
93+
9194
try (final var queryResultStream = result.getStdout()) {
9295
new BufferedReader(new InputStreamReader(queryResultStream, UTF_8))
9396
.lines()
9497
.forEach(outputProcessor::processLine);
9598
}
9699

97100
return outputProcessor.getTargets();
98-
} catch (IOException | ExecutionException e) {
101+
} catch (IOException | BuildException | ExecutionException e) {
99102
logger.error(e.getMessage(), e);
100103
return null;
101104
}

0 commit comments

Comments
 (0)