mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Remove overly broad try-catch in BaseDomainCreateFlow.createFlowRepoId()
This bit Hans as described in https://groups.google.com/d/topic/nomulus-discuss/o897-hRP_3c/discussion ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=135842526
This commit is contained in:
parent
ffc0552c15
commit
a500812a91
1 changed files with 6 additions and 7 deletions
|
@ -118,15 +118,14 @@ public abstract class BaseDomainCreateFlow<R extends DomainBase, B extends Build
|
||||||
// The domain name hasn't been validated yet, so if it's invalid, instead of throwing an error,
|
// The domain name hasn't been validated yet, so if it's invalid, instead of throwing an error,
|
||||||
// simply leave the repoId blank (it won't be needed anyway as the flow will fail when
|
// simply leave the repoId blank (it won't be needed anyway as the flow will fail when
|
||||||
// validation fails later).
|
// validation fails later).
|
||||||
try {
|
if (!InternetDomainName.isValid(command.getFullyQualifiedDomainName())) {
|
||||||
Optional<InternetDomainName> tldParsed =
|
|
||||||
findTldForName(InternetDomainName.from(command.getFullyQualifiedDomainName()));
|
|
||||||
return tldParsed.isPresent()
|
|
||||||
? createDomainRoid(ObjectifyService.allocateId(), tldParsed.get().toString())
|
|
||||||
: null;
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Optional<InternetDomainName> tldParsed =
|
||||||
|
findTldForName(InternetDomainName.from(command.getFullyQualifiedDomainName()));
|
||||||
|
return tldParsed.isPresent()
|
||||||
|
? createDomainRoid(ObjectifyService.allocateId(), tldParsed.get().toString())
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Subclasses may override this to do more specific initialization. */
|
/** Subclasses may override this to do more specific initialization. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue