aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/BugReport.java
diff options
context:
space:
mode:
authorGravatar lberki <lberki@google.com>2018-02-05 07:59:13 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-05 08:01:17 -0800
commit4741aa83145fd2d3ab0599314f7732c5b80977bd (patch)
treeb33310e226d9733ae0e538e433a54e337d6a67ed /src/main/java/com/google/devtools/build/lib/runtime/BugReport.java
parent03ad9155f765fcdc0ccf4aae30a4def9914ea0b4 (diff)
Add a "direct" mode to "blaze run" that makes the process being run a direct
child of the process where the Blaze client itself was run. Limitations: - Untested on Windows; it should work because ExecuteProgram() is implemented there, too, but since Windows doesn't support exec(), there is at least one process in between Progress towards #2815. RELNOTES[NEW]: The new "--direct_run" flag on "blaze run" lets one run interactive binaries. PiperOrigin-RevId: 184528845
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/BugReport.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BugReport.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BugReport.java b/src/main/java/com/google/devtools/build/lib/runtime/BugReport.java
index 1d8c0d874a..af1d263e08 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BugReport.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BugReport.java
@@ -87,7 +87,7 @@ public abstract class BugReport {
* halts the runtime in that case.
*/
public static void handleCrash(Throwable throwable, String... args) {
- int exitCode = getExitCodeForThrowable(throwable);
+ int exitCode = getExitCodeForThrowable(throwable).getNumericExitCode();
try {
if (alreadyHandlingCrash.compareAndSet(false, true)) {
try {
@@ -131,10 +131,10 @@ public abstract class BugReport {
}
/** Get exit code corresponding to throwable. */
- public static int getExitCodeForThrowable(Throwable throwable) {
+ public static ExitCode getExitCodeForThrowable(Throwable throwable) {
return (Throwables.getRootCause(throwable) instanceof OutOfMemoryError)
- ? ExitCode.OOM_ERROR.getNumericExitCode()
- : ExitCode.BLAZE_INTERNAL_ERROR.getNumericExitCode();
+ ? ExitCode.OOM_ERROR
+ : ExitCode.BLAZE_INTERNAL_ERROR;
}
private static void printThrowableTo(OutErr outErr, Throwable e) {