public class CompileException extends Exception
compilation errors
.
As the compiler is quite optimistic, it keeps compiling as long as possible instead of aborting for the first error. Therefore a list of errors is given here which is also appropriately formatted in the exception message.
Modifier and Type | Method and Description |
---|---|
static CompileException |
create(Template template,
List<CompileError> errors)
Creates a new exception based on the list of errors.
|
List<CompileError> |
getErrors()
Provides a list of all errors and warnings which occurred
|
Template |
getTemplate()
Returns the template for which the compilation failed.
|
void |
reportAsJSON(JSONStructuredOutput out)
Reports all collected errors as JSON, which can be processed by the ACE editor.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static CompileException create(Template template, List<CompileError> errors)
template
- the template in which the error occurrederrors
- the errors which occurred while processing the user inputpublic List<CompileError> getErrors()
public Template getTemplate()
public void reportAsJSON(JSONStructuredOutput out)
out
- the JSON output to write toCopyright © 2018. All rights reserved.