moved some more templates to template config

fixed usage of post target exceptions
This commit is contained in:
Sheldan
2020-05-13 17:45:55 +02:00
parent 80505d1014
commit cb1abaed7d
32 changed files with 34 additions and 22 deletions

View File

@@ -8,12 +8,10 @@ import java.util.List;
public class PostTargetNotFoundException extends AbstractoRunTimeException implements Templatable {
private String postTargetKey;
private List<String> availableTargets;
public PostTargetNotFoundException(String key, List<String> available) {
public PostTargetNotFoundException(String key) {
super("");
this.postTargetKey = key;
this.availableTargets = available;
}
@Override
@@ -25,7 +23,6 @@ public class PostTargetNotFoundException extends AbstractoRunTimeException imple
public Object getTemplateModel() {
HashMap<String, String> param = new HashMap<>();
param.put("key", this.postTargetKey);
param.put("available", String.join(",", this.availableTargets));
return param;
}
}

View File

@@ -3,14 +3,17 @@ package dev.sheldan.abstracto.core.exception;
import dev.sheldan.abstracto.templating.Templatable;
import java.util.HashMap;
import java.util.List;
public class PostTargetNotValidException extends AbstractoRunTimeException implements Templatable {
private String postTargetKey;
private List<String> availableTargets;
public PostTargetNotValidException(String key) {
public PostTargetNotValidException(String key, List<String> available) {
super("");
this.postTargetKey = key;
this.availableTargets = available;
}
@Override
@@ -22,6 +25,7 @@ public class PostTargetNotValidException extends AbstractoRunTimeException imple
public Object getTemplateModel() {
HashMap<String, String> param = new HashMap<>();
param.put("key", this.postTargetKey);
param.put("available", String.join(",", this.availableTargets));
return param;
}
}