mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-05 16:01:49 +00:00
[AB-206] fixing missing command channel group type
fixing not setting the server for creating a command in a channel adding exceptions for incorrect channel group type
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package dev.sheldan.abstracto.core.command.exception;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.models.exception.ChannelGroupIncorrectTypeExceptionModel;
|
||||
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
|
||||
import dev.sheldan.abstracto.core.templating.Templatable;
|
||||
|
||||
public class ChannelGroupIncorrectTypeException extends AbstractoRunTimeException implements Templatable {
|
||||
|
||||
private final ChannelGroupIncorrectTypeExceptionModel model;
|
||||
|
||||
public ChannelGroupIncorrectTypeException(String key, String correctType) {
|
||||
super("Channel group has the incorrect type.");
|
||||
this.model = ChannelGroupIncorrectTypeExceptionModel.builder().name(key).correctType(correctType).build();
|
||||
}
|
||||
@Override
|
||||
public String getTemplateName() {
|
||||
return "channel_group_not_found_exception";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getTemplateModel() {
|
||||
return model;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package dev.sheldan.abstracto.core.command.models.exception;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class ChannelGroupIncorrectTypeExceptionModel implements Serializable {
|
||||
private String name;
|
||||
private String correctType;
|
||||
}
|
||||
Reference in New Issue
Block a user