Skip to content

Commit 113eaca

Browse files
thiicopybara-github
authored andcommitted
Do not hide BulkTransferException messages when there were more than one exception
Previously, when there were more than one BulkTransferException, it would be reported like this: ``` Executing genrule //:foo failed: Exec failed due to IOException: 221 errors during bulk transfer ``` which didn't include the underlying exception messages. The only case that underlying exceptions were included was when there was only one exception. This change patches the error message to include all the exception messages, which helps diagnose BulkTransferException. Closes #14981. PiperOrigin-RevId: 432921283
1 parent b1bf9d6 commit 113eaca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/google/devtools/build/lib/remote/common/BulkTransferException.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414
package com.google.devtools.build.lib.remote.common;
1515

16+
import com.google.common.base.Joiner;
1617
import java.io.IOException;
1718

1819
/**
@@ -57,6 +58,9 @@ public String getMessage() {
5758
if (super.getSuppressed().length == 1) {
5859
return super.getSuppressed()[0].getMessage();
5960
}
60-
return String.format("%d errors during bulk transfer", super.getSuppressed().length);
61+
String errorSummary =
62+
String.format("%d errors during bulk transfer:", super.getSuppressed().length);
63+
String combinedSuberrors = Joiner.on('\n').join(super.getSuppressed());
64+
return Joiner.on('\n').join(errorSummary, combinedSuberrors);
6165
}
6266
}

0 commit comments

Comments
 (0)