mirror of
https://github.com/google/nomulus
synced 2025-12-23 06:15:42 +00: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:
@@ -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,
|
||||
// simply leave the repoId blank (it won't be needed anyway as the flow will fail when
|
||||
// validation fails later).
|
||||
try {
|
||||
Optional<InternetDomainName> tldParsed =
|
||||
findTldForName(InternetDomainName.from(command.getFullyQualifiedDomainName()));
|
||||
return tldParsed.isPresent()
|
||||
? createDomainRoid(ObjectifyService.allocateId(), tldParsed.get().toString())
|
||||
: null;
|
||||
} catch (IllegalArgumentException e) {
|
||||
if (!InternetDomainName.isValid(command.getFullyQualifiedDomainName())) {
|
||||
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. */
|
||||
|
||||
Reference in New Issue
Block a user