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

[7.1.0] Fix crash on bazel mod error containing % #20651

Merged
merged 5 commits into from
Jan 9, 2024
Merged
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 @@ -278,7 +278,7 @@ private BlazeCommandResult execInternal(CommandEnvironment env, OptionsParsingRe
baseModule.getUnusedDeps()));
} catch (InvalidArgumentException | OptionsParsingException e) {
throw new InvalidArgumentException(
String.format("In extension argument: %s %s", arg, e.getMessage()),
String.format("In extension argument %s: %s", arg, e.getMessage()),
Code.INVALID_ARGUMENTS,
e);
}
Expand Down Expand Up @@ -494,13 +494,10 @@ private static ImmutableSortedSet<ModuleExtensionId> extensionArgListToIds(

private static BlazeCommandResult reportAndCreateFailureResult(
CommandEnvironment env, String message, Code detailedCode) {
if (message.charAt(message.length() - 1) != '.') {
message = message.concat(".");
}
String fullMessage =
String.format(
message.concat(" Type '%s help mod' for syntax and help."),
env.getRuntime().getProductName());
"%s%s Type '%s help mod' for syntax and help.",
message, message.endsWith(".") ? "" : ".", env.getRuntime().getProductName());
env.getReporter().handle(Event.error(fullMessage));
return createFailureResult(fullMessage, detailedCode);
}
Expand Down
Loading