/** * The work around the problematic cases where we should throw a {@link TemplateException}, but we are inside * a {@link TemplateModel} method and so we can only throw {@link TemplateModelException}-s. */ public static TemplateModelException ensureIsTemplateModelException(String modelOpMsg, TemplateException e) { if (e instanceof TemplateModelException) { return (TemplateModelException) e; } else { return new _TemplateModelException( _TemplateAPI.getBlamedExpression(e), e.getCause(), e.getEnvironment(), modelOpMsg); } }
/** * The work around the problematic cases where we should throw a {@link TemplateException}, but we are inside * a {@link TemplateModel} method and so we can only throw {@link TemplateModelException}-s. */ public static TemplateModelException ensureIsTemplateModelException(String modelOpMsg, TemplateException e) { if (e instanceof TemplateModelException) { return (TemplateModelException) e; } else { return new _TemplateModelException( _TemplateAPI.getBlamedExpression(e), e.getCause(), e.getEnvironment(), modelOpMsg); } }
/** * The work around the problematic cases where we should throw a {@link TemplateException}, but we are inside * a {@link TemplateModel} method and so we can only throw {@link TemplateModelException}-s. */ public static TemplateModelException ensureIsTemplateModelException(String modelOpMsg, TemplateException e) { if (e instanceof TemplateModelException) { return (TemplateModelException) e; } else { return new _TemplateModelException( _TemplateAPI.getBlamedExpression(e), e.getCause(), e.getEnvironment(), modelOpMsg); } }