All Downloads are FREE. Search and download functionalities are using the official Maven repository.

play.exceptions.TemplateExecutionException Maven / Gradle / Ivy

package play.exceptions;

import play.templates.Template;

/**
 * An exception during template execution
 */
public class TemplateExecutionException extends TemplateException {

    public TemplateExecutionException(Template template, Integer lineNumber, String message, Throwable cause) {
        super(template, lineNumber, message, cause);
    }

    @Override
    public String getErrorTitle() {
        return String.format("Template execution error");
    }

    @Override
    public String getErrorDescription() {
        return  String.format("Execution error occured in template %s. Exception raised was %s : %s.", getSourceFile(), getCause().getClass().getSimpleName(), getMessage());
    }
    
    public static class DoBodyException extends RuntimeException {
        public DoBodyException(Throwable cause) {
            super(cause);
        }
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy