From 90a4809862018f98265bb953056b4cab650b75ce Mon Sep 17 00:00:00 2001 From: guyben Date: Wed, 7 Feb 2018 08:04:28 -0800 Subject: [PATCH] Add debug string on checkArgument failure ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=184838852 --- java/google/registry/tools/CreateOrUpdateTldCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/google/registry/tools/CreateOrUpdateTldCommand.java b/java/google/registry/tools/CreateOrUpdateTldCommand.java index 1cbe8907e..1b1d9e7a6 100644 --- a/java/google/registry/tools/CreateOrUpdateTldCommand.java +++ b/java/google/registry/tools/CreateOrUpdateTldCommand.java @@ -271,7 +271,11 @@ abstract class CreateOrUpdateTldCommand extends MutatingCommand { checkArgument(roidSuffix == null || tlds.size() == 1, "Can't update roid suffixes on multiple TLDs simultaneously"); for (String tld : tlds) { - checkArgument(tld.equals(canonicalizeDomainName(tld))); + checkArgument( + tld.equals(canonicalizeDomainName(tld)), + "TLD '%s' should be given in the canonical form '%s'", + tld, + canonicalizeDomainName(tld)); checkArgument( !CharMatcher.javaDigit().matches(tld.charAt(0)), "TLDs cannot begin with a number");