Better internal error response

This commit is contained in:
Rsl1122 2017-11-16 18:30:52 +02:00
parent b02998442a
commit c3b3985ef4
2 changed files with 6 additions and 4 deletions

View File

@ -16,17 +16,19 @@ public class InternalErrorResponse extends ErrorResponse {
StringBuilder paragraph = new StringBuilder();
paragraph.append("Please report this issue here: ");
paragraph.append(Html.LINK.parse("https://github.com/Rsl1122/Plan-PlayerAnalytics/issues", "Issues"));
paragraph.append("<br><br>");
paragraph.append("<br><br><pre>");
paragraph.append(e).append(" | ").append(cause);
for (StackTraceElement element : e.getStackTrace()) {
paragraph.append("<br>");
paragraph.append("&nbsp;&nbsp;").append(element);
paragraph.append(" ").append(element);
}
if (e.getCause() != null) {
appendCause(e.getCause(), paragraph);
}
paragraph.append("</pre>");
super.setParagraph(paragraph.toString());
super.replacePlaceholders();
}
@ -35,7 +37,7 @@ public class InternalErrorResponse extends ErrorResponse {
paragraph.append("<br>Caused by: ").append(cause);
for (StackTraceElement element : cause.getStackTrace()) {
paragraph.append("<br>");
paragraph.append("&nbsp;&nbsp;").append(element);
paragraph.append(" ").append(element);
}
if (cause.getCause() != null) {
appendCause(cause.getCause(), paragraph);

View File

@ -28,7 +28,7 @@ public enum Html {
COLOR_E("<span class=\"yellow\">"),
COLOR_F("<span class=\"white\">"),
//
FONT_AWESOME_ICON("<i class=\"fa fa-${0}\" aria-hidden=\"true\"></i>"),
FONT_AWESOME_ICON("<i class=\"fa fa-${0}\"></i>"),
SPAN("${0}</span>"),
BUTTON("<a class=\"button\" href=\"${0}\">${1}</a>"),
BUTTON_CLASS("class=\"button\""),