mirror of
https://github.com/google/nomulus
synced 2026-01-09 23:47:49 +00:00
Load referenced contact/hosts from EPP more efficiently
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=122459862
This commit is contained in:
committed by
Justine Tunney
parent
86f3287761
commit
618050dc32
@@ -17,7 +17,9 @@ package google.registry.flows;
|
||||
import static java.lang.annotation.ElementType.TYPE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import google.registry.model.annotations.ExternalMessagingName;
|
||||
import google.registry.model.eppinput.EppInput.InnerCommand;
|
||||
@@ -117,11 +119,21 @@ public abstract class EppException extends Exception {
|
||||
super(
|
||||
String.format(
|
||||
"The %s with given ID (%s) doesn't exist.",
|
||||
!type.isAnnotationPresent(ExternalMessagingName.class)
|
||||
? "object"
|
||||
: type.getAnnotation(ExternalMessagingName.class).value(),
|
||||
type.isAnnotationPresent(ExternalMessagingName.class)
|
||||
? type.getAnnotation(ExternalMessagingName.class).value()
|
||||
: "object",
|
||||
id));
|
||||
}
|
||||
|
||||
public ObjectDoesNotExistException(Class<?> type, ImmutableSet<String> ids) {
|
||||
super(
|
||||
String.format(
|
||||
"The %s with given IDs (%s) don't exist.",
|
||||
type.isAnnotationPresent(ExternalMessagingName.class)
|
||||
? type.getAnnotation(ExternalMessagingName.class).value() + " objects"
|
||||
: "objects",
|
||||
Joiner.on(',').join(ids)));
|
||||
}
|
||||
}
|
||||
|
||||
/** Abstract exception class. Do not throw this directly or catch in tests. */
|
||||
|
||||
Reference in New Issue
Block a user