aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2015-07-08 21:43:31 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-07-10 17:15:54 +0000
commit8990739a4316140972d4e59f53f54853a46cef4e (patch)
tree76d5df4d67d7cd417aaa8334bc9e96c983549d3f /src/main/java/com/google/devtools/build/lib/runtime
parentc7d2c54d7a78d4515d4788e31c5474b8089ec37c (diff)
Throw InterruptedException directly if a query is interrupted, instead of wrapping it in a QueryException.
QueryException should usually indicate a persistent failure, while an InterruptedException is transient. Wrapping the InterruptedException in a QueryException just obfuscates state. -- MOS_MIGRATED_REVID=97815388
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java
index 72ec9ad8f7..2792a15b66 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java
@@ -126,7 +126,7 @@ public final class QueryCommand implements BlazeCommand {
QueryEvalResult<Target> result;
try {
result = env.evaluateQuery(expr);
- } catch (QueryException e) {
+ } catch (QueryException | InterruptedException e) {
// Keep consistent with reportBuildFileError()
runtime.getReporter().handle(Event.error(e.getMessage()));
return ExitCode.ANALYSIS_FAILURE;