Be verbose when the creation of the BuildEventTransport fails.
Make sure we log the actual cause behind the problem on the command line
but also log a full stack trace in the server log to help debugging.
RELNOTES: None.
@@ -47,6 +47,7 @@ import com.google.devtools.common.options.OptionsParsingException;
import com.google.devtools.common.options.OptionsParsingResult;
import java.io.IOException;
import java.util.Set;
+import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
@@ -142,11 +143,12 @@ public abstract class BuildEventServiceModule<T extends BuildEventServiceOptions
try {
besTransport = tryCreateBesTransport(env);
} catch (Exception e) {
+ String message = "Failed to create BuildEventTransport: " + e;
+ logger.log(Level.WARNING, message, e);
reportError(
env.getReporter(),
env.getBlazeModuleEnvironment(),
- new AbruptExitException(
- "Failed while creating BuildEventTransport", ExitCode.PUBLISH_ERROR));
+ new AbruptExitException(message, ExitCode.PUBLISH_ERROR, e));
return null;
}
