Created the SimpleUsageErrorHandler to handle the error with a simple error message
This commit is contained in:
@ -0,0 +1,16 @@
|
|||||||
|
package de.gnmyt.autoresponder.commands.usage.handler;
|
||||||
|
|
||||||
|
import de.gnmyt.autoresponder.commands.usage.UsageException;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SimpleUsageErrorHandler extends UsageHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> handleUsageException(UsageException exception) {
|
||||||
|
return new ArrayList<>(Collections.singletonList(exception.getMessage()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user