From 92125f8ea1963b31efcc486d4fa721d26734b9ab Mon Sep 17 00:00:00 2001 From: lberki Date: Tue, 6 Feb 2018 07:32:07 -0800 Subject: Remove ShutdownBlazeServerException in favor of indicating that the server should be shut down in BlazeCommandResult. RELNOTES: None. PiperOrigin-RevId: 184678994 --- .../devtools/build/lib/runtime/commands/ShutdownCommand.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java') diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java index f242c9d7ce..4808b39b24 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java @@ -14,7 +14,6 @@ package com.google.devtools.build.lib.runtime.commands; import com.google.devtools.build.lib.runtime.BlazeCommand; -import com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.ShutdownBlazeServerException; import com.google.devtools.build.lib.runtime.BlazeCommandResult; import com.google.devtools.build.lib.runtime.Command; import com.google.devtools.build.lib.runtime.CommandEnvironment; @@ -57,8 +56,7 @@ public final class ShutdownCommand implements BlazeCommand { public void editOptions(OptionsParser optionsParser) {} @Override - public BlazeCommandResult exec(CommandEnvironment env, OptionsProvider options) - throws ShutdownBlazeServerException { + public BlazeCommandResult exec(CommandEnvironment env, OptionsProvider options) { int limit = options.getOptions(Options.class).heapSizeLimit; // Iff limit is non-zero, shut down the server if total memory exceeds the @@ -70,8 +68,9 @@ public final class ShutdownCommand implements BlazeCommand { if (limit == 0 || Runtime.getRuntime().totalMemory() > limit * 1000L * 1000) { - throw new ShutdownBlazeServerException(ExitCode.SUCCESS); + return BlazeCommandResult.shutdown(ExitCode.SUCCESS); } + return BlazeCommandResult.exitCode(ExitCode.SUCCESS); } -- cgit v1.2.3