aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/RegisteredToolchainsFunction.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/RegisteredToolchainsFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/RegisteredToolchainsFunction.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/RegisteredToolchainsFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/RegisteredToolchainsFunction.java
index 5d3b580853..b581130b8b 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/RegisteredToolchainsFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/RegisteredToolchainsFunction.java
@@ -172,14 +172,13 @@ public class RegisteredToolchainsFunction implements SkyFunction {
* Used to indicate that the given {@link Label} represents a {@link ConfiguredTarget} which is
* not a valid {@link DeclaredToolchainInfo} provider.
*/
- public static final class InvalidToolchainLabelException extends Exception {
+ public static final class InvalidToolchainLabelException extends ToolchainException {
public InvalidToolchainLabelException(Label invalidLabel) {
super(
- String.format(
- "invalid registered toolchain '%s': "
- + "target does not provide the DeclaredToolchainInfo provider",
- invalidLabel));
+ formatMessage(
+ invalidLabel.getCanonicalForm(),
+ "target does not provide the DeclaredToolchainInfo provider"));
}
public InvalidToolchainLabelException(ToolchainUtil.InvalidTargetPatternException e) {
@@ -187,14 +186,15 @@ public class RegisteredToolchainsFunction implements SkyFunction {
}
public InvalidToolchainLabelException(String invalidPattern, TargetParsingException e) {
- super(
- String.format("invalid registered toolchain '%s': %s", invalidPattern, e.getMessage()),
- e);
+ super(formatMessage(invalidPattern, e.getMessage()), e);
}
public InvalidToolchainLabelException(Label invalidLabel, ConfiguredValueCreationException e) {
- super(
- String.format("invalid registered toolchain '%s': %s", invalidLabel, e.getMessage()), e);
+ super(formatMessage(invalidLabel.getCanonicalForm(), e.getMessage()), e);
+ }
+
+ private static String formatMessage(String invalidPattern, String reason) {
+ return String.format("invalid registered toolchain '%s': %s", invalidPattern, reason);
}
}