Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.2.0] Fix message generation of ActionExecutionException #18257

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public ActionExecutionException(
ActionAnalysisMetadata action,
boolean catastrophe,
DetailedExitCode detailedExitCode) {
super(combineMessages(message, cause), cause);
super(message, cause);
this.action = action;
this.catastrophe = catastrophe;
this.detailedExitCode = checkNotNull(detailedExitCode);
Expand Down Expand Up @@ -96,7 +96,7 @@ public ActionExecutionException(
NestedSet<Cause> rootCauses,
boolean catastrophe,
DetailedExitCode detailedExitCode) {
super(combineMessages(message, cause), cause);
super(message, cause);
this.action = action;
this.rootCauses = rootCauses;
this.catastrophe = catastrophe;
Expand Down Expand Up @@ -203,12 +203,4 @@ public DetailedExitCode getDetailedExitCode() {
public boolean showError() {
return getMessage() != null;
}

@Nullable
private static String combineMessages(String message, @Nullable Throwable cause) {
if (cause == null || cause.getMessage() == null) {
return message;
}
return message + ": " + cause.getMessage();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,11 @@ private ActionExecutionException toActionExecutionException(
} else {
ex = new ActionExecutionException(message, cause, action, false, code);
}
printError(ex.getMessage(), action, actionOutput);
String reportMessage = ex.getMessage();
if (cause != null && cause.getMessage() != null) {
reportMessage += ": " + cause.getMessage();
}
printError(reportMessage, action, actionOutput);
return ex;
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/skyframe/serialization/testutils",
"//src/main/java/com/google/devtools/build/lib/skyframe/serialization/testutils:depsutils",
"//src/main/java/com/google/devtools/build/lib/util",
"//src/main/java/com/google/devtools/build/lib/util:detailed_exit_code",
"//src/main/java/com/google/devtools/build/lib/util:filetype",
"//src/main/java/com/google/devtools/build/lib/util:string",
"//src/main/java/com/google/devtools/build/lib/vfs",
Expand Down