diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java index 58c6c668a6..5b5c56eeb0 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java @@ -17,6 +17,7 @@ package com.google.devtools.build.lib.remote; import com.google.common.collect.ImmutableMap; import com.google.devtools.build.lib.actions.ActionInput; import com.google.devtools.build.lib.actions.ActionInputFileCache; +import com.google.devtools.build.lib.actions.EnvironmentalExecException; import com.google.devtools.build.lib.actions.ExecException; import com.google.devtools.build.lib.actions.Spawn; import com.google.devtools.build.lib.actions.Spawns; @@ -143,12 +144,22 @@ final class RemoteSpawnRunner implements SpawnRunner { if (options.remoteLocalFallback) { return execLocally(spawn, policy, remoteCache, actionKey); } - throw e; + + io.grpc.Status grpcStatus = io.grpc.Status.fromThrowable(e); + final String message; + if (io.grpc.Status.UNAVAILABLE.getCode().equals(grpcStatus.getCode())) { + message = "The remote executor/cache is unavailable: " + grpcStatus.getDescription(); + } else { + message = "I/O Error in remote cache/executor: " + e.getMessage(); + } + throw new EnvironmentalExecException(message, true); } catch (CacheNotFoundException e) { if (options.remoteLocalFallback) { return execLocally(spawn, policy, remoteCache, actionKey); } - throw new IOException(e); + + String message = "Failed to download from remote cache: " + e.getMessage(); + throw new EnvironmentalExecException(message, true); } } |