mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-02 16:05:00 +00:00
merged exceptions for setup steps to one common exception, which contains the concrete exception
added exception handling for incorrect mod mail category id
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package dev.sheldan.abstracto.modmail.setup;
|
||||
|
||||
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
|
||||
import dev.sheldan.abstracto.templating.Templatable;
|
||||
|
||||
public class InvalidCategoryException extends AbstractoRunTimeException implements Templatable {
|
||||
public InvalidCategoryException() {
|
||||
super("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateName() {
|
||||
return "setup_category_not_valid_exception";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getTemplateModel() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class ModMailCategorySetupBean implements ModMailCategorySetup {
|
||||
.delayedActionConfigList(delayedSteps)
|
||||
.build();
|
||||
} else {
|
||||
throw new AbstractoRunTimeException("Category id does not conform.");
|
||||
throw new InvalidCategoryException();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public class ModMailCategorySetupBean implements ModMailCategorySetup {
|
||||
future.complete(result);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to handle post target step.", e);
|
||||
future.completeExceptionally(e);
|
||||
future.completeExceptionally(new SetupStepException(e));
|
||||
}
|
||||
};
|
||||
interactiveService.createMessageWithResponse(messageText, aUserInAServer, channel.get(), parameter.getPreviousMessageId(), configAction, finalAction);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<#include "setup_category_not_valid_exception_message">
|
||||
Reference in New Issue
Block a user