public final class ExplodingErrorReporter extends AbstractErrorReporter
ErrorReporter implementation that throws an AssertionError whenever an error
is reported to it. This should only be used when no errors are expected. This is seldom
desirable in production code, 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.Checkpoint| Modifier and Type | Method and Description |
|---|---|
static ErrorReporter |
get() |
protected int |
getCurrentNumberOfErrors() |
void |
report(SourceLocation sourceLocation,
SoyErrorKind error,
Object... args)
Reports the given
error, formatted according to args and associated with
the given sourceLocation. |
checkpoint, errorsSincepublic static ErrorReporter get()
public void report(SourceLocation sourceLocation, SoyErrorKind error, Object... args)
ErrorReportererror, formatted according to args and associated with
the given sourceLocation.protected int getCurrentNumberOfErrors()
getCurrentNumberOfErrors in class AbstractErrorReporter