added more specific exceptions

This commit is contained in:
Sheldan
2020-05-13 23:46:58 +02:00
parent cf04687f04
commit b591ae497d
12 changed files with 134 additions and 20 deletions

View File

@@ -0,0 +1,27 @@
package dev.sheldan.abstracto.utility.exception;
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
import dev.sheldan.abstracto.templating.Templatable;
import java.util.HashMap;
public class ReminderNotFoundException extends AbstractoRunTimeException implements Templatable {
private Long reminderId;
public ReminderNotFoundException(Long reminderId) {
super("");
this.reminderId = reminderId;
}
@Override
public String getTemplateName() {
return "reminder_does_not_exist_exception";
}
@Override
public Object getTemplateModel() {
HashMap<String, Long> params = new HashMap<>();
params.put("id", this.reminderId);
return params;
}
}

View File

@@ -0,0 +1,27 @@
package dev.sheldan.abstracto.utility.exception;
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
import dev.sheldan.abstracto.templating.Templatable;
import java.util.HashMap;
public class SuggestionNotFoundException extends AbstractoRunTimeException implements Templatable {
private Long suggestionId;
public SuggestionNotFoundException(Long suggestionId) {
super("");
this.suggestionId = suggestionId;
}
@Override
public String getTemplateName() {
return "suggestion_does_not_exist_exception";
}
@Override
public Object getTemplateModel() {
HashMap<String, Long> params = new HashMap<>();
params.put("id", this.suggestionId);
return params;
}
}