public final class ExplodingErrorReporter extends ErrorReporterImpl
ErrorReporter implementation that throws an AssertionError whenever an error
is reported to it. This is never desirable in production code (which is why it is under
javatests), but often desirable in tests, which should fail in the presence of any errors
that are not specifically checked for.
To write a test that does not have this exploding behavior (for example, a test that needs
to check the full list of errors encountered during compilation), pass a non-exploding
ErrorReporter instance to
com.google.template.soy.SoyFileSetParserBuilder#errorReporter.
ErrorReporter.Checkpointerrors| Modifier and Type | Method and Description |
|---|---|
static ErrorReporter |
get() |
void |
report(SourceLocation sourceLocation,
SoyError error,
String... args)
Reports the given
error, formatted according to args and associated with
the given sourceLocation. |
checkpoint, errorsSince, getErrorspublic void report(SourceLocation sourceLocation, SoyError error, String... args)
ErrorReportererror, formatted according to args and associated with
the given sourceLocation.report in interface ErrorReporterreport in class ErrorReporterImplpublic static ErrorReporter get()