diff --git a/src/main/java/com/google/devtools/build/lib/network/ConnectivityStatus.java b/src/main/java/com/google/devtools/build/lib/network/ConnectivityStatus.java index a0ee0ee3b948c7..dbfd9909af08eb 100644 --- a/src/main/java/com/google/devtools/build/lib/network/ConnectivityStatus.java +++ b/src/main/java/com/google/devtools/build/lib/network/ConnectivityStatus.java @@ -18,9 +18,9 @@ public final class ConnectivityStatus { /** Enumerates common connectivity statuses and their generic short warnings. */ public enum Status { - NO_CREDENTIALS("No credentials."), - NO_NETWORK("No internet connection."), - NOT_REACHABLE("Service not reachable."), + NO_CREDENTIALS("No credentials"), + NO_NETWORK("No internet connection"), + NOT_REACHABLE("Service not reachable"), OK(""); /** Generic warning associated with this status. */ @@ -37,9 +37,9 @@ public enum Status { /** Generic category type for this status, which contains a generic warning. */ public final Status status; - /** Returns the complete formatted warning for this status. */ - public String fullWarning() { - return status.shortWarning + " " + serviceInfo; + @Override + public String toString() { + return serviceInfo.isEmpty() ? status.shortWarning : status.shortWarning + ": " + serviceInfo; } /**