mirror of
https://github.com/google/nomulus
synced 2026-01-06 21:47:31 +00:00
Simplify an exception's constructor.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=125127036
This commit is contained in:
@@ -23,7 +23,7 @@ import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import google.registry.model.annotations.ExternalMessagingName;
|
||||
import google.registry.model.eppinput.EppInput.InnerCommand;
|
||||
import google.registry.model.eppinput.ResourceCommand;
|
||||
import google.registry.model.eppinput.EppInput.ResourceCommandWrapper;
|
||||
import google.registry.model.eppoutput.Result;
|
||||
import google.registry.model.eppoutput.Result.Code;
|
||||
|
||||
@@ -211,11 +211,13 @@ public abstract class EppException extends Exception {
|
||||
/** Specified command is not implemented. */
|
||||
@EppResultCode(Code.UnimplementedCommand)
|
||||
public static class UnimplementedCommandException extends EppException {
|
||||
public UnimplementedCommandException(InnerCommand command, ResourceCommand resourceCommand) {
|
||||
public UnimplementedCommandException(InnerCommand command) {
|
||||
super(String.format(
|
||||
"No flow found for %s with extension %s",
|
||||
command.getClass().getSimpleName(),
|
||||
resourceCommand == null ? null : resourceCommand.getClass().getSimpleName()));
|
||||
command instanceof ResourceCommandWrapper
|
||||
? ((ResourceCommandWrapper) command).getResourceCommand().getClass().getSimpleName()
|
||||
: null));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -326,10 +326,7 @@ public class FlowPicker {
|
||||
}
|
||||
}
|
||||
// Nothing usable was found, so throw an exception.
|
||||
throw new UnimplementedCommandException(
|
||||
innerCommand,
|
||||
innerCommand instanceof ResourceCommandWrapper
|
||||
? ((ResourceCommandWrapper) innerCommand).getResourceCommand() : null);
|
||||
throw new UnimplementedCommandException(innerCommand);
|
||||
}
|
||||
|
||||
/** Command missing. */
|
||||
|
||||
Reference in New Issue
Block a user