use of com.djrapitops.plan.exceptions.ExceptionWithContext in project Plan by plan-player-analytics.
the class InternalErrorPage method createContent.
private String createContent() {
TextStringBuilder paragraph = new TextStringBuilder();
paragraph.append("Please report this issue here: ");
paragraph.append(Html.LINK.create("https://github.com/plan-player-analytics/Plan/issues", "Issues"));
paragraph.append("<br><br><pre>");
paragraph.append(error).append(" | ").append(errorMsg);
if (error instanceof ExceptionWithContext) {
((ExceptionWithContext) error).getContext().ifPresent(context -> paragraph.append(context.getWhatToDo().map(whatToDo -> "<br>What to do about it: " + whatToDo).orElse("<br>Error message: " + error.getMessage())).append("<br><br>Related things:<br>").appendWithSeparators(context.toLines(), "<br>").append("<br>"));
}
for (StackTraceElement element : error.getStackTrace()) {
paragraph.append("<br>");
paragraph.append(" ").append(element);
}
if (error.getCause() != null) {
appendCause(error.getCause(), paragraph);
}
paragraph.append("</pre>");
return paragraph.toString();
}
Aggregations