mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-16 20:29:08 +00:00
added more specific exceptions
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user