Make sure we communicate a BEP transport crash to the caller.

RELNOTES: None
PiperOrigin-RevId: 312696038
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/FileTransport.java b/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/FileTransport.java
index 098abb0..a704d7f 100644
--- a/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/FileTransport.java
+++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/FileTransport.java
@@ -18,7 +18,6 @@
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Function;
-import com.google.common.base.Throwables;
 import com.google.common.flogger.GoogleLogger;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -145,7 +144,9 @@
           }
         }
       } catch (ExecutionException e) {
-        Throwables.throwIfUnchecked(e.getCause());
+        if (e.getCause() instanceof RuntimeException || e.getCause() instanceof Error) {
+          closeFuture.setException(e.getCause());
+        }
         exitFailure(e);
       } catch (IOException | InterruptedException | CancellationException e) {
         exitFailure(e);