aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/remote
diff options
context:
space:
mode:
authorGravatar ulfjack <ulfjack@google.com>2017-07-04 07:07:00 -0400
committerGravatar John Cater <jcater@google.com>2017-07-05 10:57:57 -0400
commit94530f57ebb72bb952217aae0351474589ce6d97 (patch)
treeec748cc05af838af671d1870b2b251e9fa9d58da /src/main/java/com/google/devtools/build/lib/remote
parent27762e2207d2ea817499756298f08c715790d187 (diff)
Better error handling in RemoteSpawnStrategy
Make sure that we print the failing command / target in all cases. PiperOrigin-RevId: 160881591
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/remote')
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java
index 49eb04c938..52cad13e21 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java
@@ -306,7 +306,11 @@ final class RemoteSpawnStrategy implements SpawnActionContext {
if (remoteOptions.remoteLocalFallback) {
execLocally(spawn, actionExecutionContext, remoteCache, actionKey);
} else {
- throw new UserExecException(e.getCause());
+ String cwd = actionExecutionContext.getExecRoot().getPathString();
+ String message =
+ CommandFailureUtils.describeCommandFailure(
+ verboseFailures, spawn.getArguments(), spawn.getEnvironment(), cwd);
+ throw new UserExecException(message, e.getCause());
}
} catch (CacheNotFoundException e) {
// TODO(olaola): handle this exception by reuploading / reexecuting the action remotely.
@@ -314,7 +318,11 @@ final class RemoteSpawnStrategy implements SpawnActionContext {
if (remoteOptions.remoteLocalFallback) {
execLocally(spawn, actionExecutionContext, remoteCache, actionKey);
} else {
- throw new UserExecException(e);
+ String cwd = actionExecutionContext.getExecRoot().getPathString();
+ String message =
+ CommandFailureUtils.describeCommandFailure(
+ verboseFailures, spawn.getArguments(), spawn.getEnvironment(), cwd);
+ throw new UserExecException(message, e);
}
} catch (IOException e) {
throw new UserExecException("Unexpected IO error.", e);