mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Simplify an exception's constructor.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=125127036
This commit is contained in:
parent
31ddced437
commit
1d2d81492e
2 changed files with 6 additions and 7 deletions
|
@ -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. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue