2
0
Fork 0
mirror of https://github.com/ethauvin/rife2.git synced 2025-04-30 18:48:13 -07:00

Better pretty exception printing for some template exceptions

This commit is contained in:
Geert Bevin 2022-12-15 12:25:18 -05:00
parent 7b081368a7
commit b0896942fd

View file

@ -5,7 +5,7 @@
package rife.tools; package rife.tools;
import rife.template.Template; import rife.template.Template;
import rife.template.exceptions.SyntaxErrorException; import rife.template.exceptions.*;
public abstract class ExceptionFormattingUtils { public abstract class ExceptionFormattingUtils {
private static final int DEFAULT_STACKTRACELIMIT = 15; private static final int DEFAULT_STACKTRACELIMIT = 15;
@ -92,7 +92,9 @@ public abstract class ExceptionFormattingUtils {
template.setValue("exception_stack_trace", stack_trace_out.toString()); template.setValue("exception_stack_trace", stack_trace_out.toString());
} }
if (exception instanceof SyntaxErrorException) { if (exception instanceof SyntaxErrorException ||
exception instanceof IncludeNotFoundException ||
exception instanceof CircularIncludesException) {
exceptions.append(template.getBlock("exception_compilation")); exceptions.append(template.getBlock("exception_compilation"));
} else { } else {
exceptions.append(template.getBlock("exception")); exceptions.append(template.getBlock("exception"));