Add detailed exit code to CommandCompleteEvent, and make sure that crash failure details from the throwable triggering the crash are added.

PiperOrigin-RevId: 305885101
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/BlazeRuntimeTest.java b/src/test/java/com/google/devtools/build/lib/runtime/BlazeRuntimeTest.java
index eb30e49..5eacae7 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/BlazeRuntimeTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/BlazeRuntimeTest.java
@@ -22,6 +22,7 @@
 import com.google.devtools.build.lib.analysis.config.BuildOptions;
 import com.google.devtools.build.lib.exec.BinTools;
 import com.google.devtools.build.lib.runtime.commands.VersionCommand;
+import com.google.devtools.build.lib.util.DetailedExitCode;
 import com.google.devtools.build.lib.util.ExitCode;
 import com.google.devtools.build.lib.vfs.FileSystem;
 import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem;
@@ -132,7 +133,7 @@
             options,
             ImmutableList.of());
     runtime.beforeCommand(env, options.getOptions(CommonCommandOptions.class));
-    runtime.cleanUpForCrash(ExitCode.OOM_ERROR);
+    runtime.cleanUpForCrash(DetailedExitCode.justExitCode(ExitCode.OOM_ERROR));
     BlazeCommandResult mainThreadCrash = BlazeCommandResult.exitCode(ExitCode.BLAZE_INTERNAL_ERROR);
     assertThat(runtime.afterCommand(env, mainThreadCrash).getExitCode())
         .isEqualTo(ExitCode.OOM_ERROR);