mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-20 04:31:06 +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:
@@ -1,19 +0,0 @@
|
||||
package dev.sheldan.abstracto.core.exception;
|
||||
|
||||
import dev.sheldan.abstracto.templating.Templatable;
|
||||
|
||||
public class SetupStepException extends AbstractoRunTimeException implements Templatable {
|
||||
public SetupStepException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateName() {
|
||||
return "setup_configuration_timeout";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getTemplateModel() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package dev.sheldan.abstracto.core.interactive;
|
||||
|
||||
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
|
||||
import dev.sheldan.abstracto.templating.Templatable;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class SetupStepException extends AbstractoRunTimeException implements Templatable {
|
||||
public SetupStepException(Throwable throwable) {
|
||||
super("", throwable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateName() {
|
||||
return "setup_step_exception";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getTemplateModel() {
|
||||
HashMap<String, Object> stringStringHashMap = new HashMap<>();
|
||||
if(getCause() instanceof Templatable) {
|
||||
Templatable templatable = (Templatable) getCause();
|
||||
stringStringHashMap.put("templateKey", templatable.getTemplateName());
|
||||
stringStringHashMap.put("templateModel", templatable.getTemplateModel());
|
||||
}
|
||||
stringStringHashMap.put("message", getCause().getMessage());
|
||||
|
||||
return stringStringHashMap;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user