Created the SimpleUsageErrorHandler to handle the error with a simple error message

This commit is contained in:
2021-10-03 18:53:37 +02:00
parent 4c1b270c5e
commit 23b158c1eb

View File

@ -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()));
}
}