Browse Source

catch(TemplateException e) 添加捕获 ParseException

James 3 years ago
parent
commit
4ceb927855

+ 1 - 1
src/main/java/com/jfinal/template/expr/ast/Arith.java

@@ -78,7 +78,7 @@ public class Arith extends Expr {
 	public Object eval(Scope scope) {
 		try {
 			return doEval(scope);
-		} catch (TemplateException e) {
+		} catch (TemplateException | ParseException e) {
 			throw e;
 		} catch (Exception e) {
 			throw new TemplateException(e.getMessage(), location, e);

+ 1 - 1
src/main/java/com/jfinal/template/ext/directive/DateDirective.java

@@ -96,7 +96,7 @@ public class DateDirective extends Directive {
 				throw new TemplateException("The first parameter of #date directive can not be " + date.getClass().getName(), location);
 			}
 
-		} catch (TemplateException e) {
+		} catch (TemplateException | ParseException e) {
 			throw e;
 		} catch (Exception e) {
 			throw new TemplateException(e.getMessage(), location, e);

+ 2 - 2
src/main/java/com/jfinal/template/ext/directive/EscapeDirective.java

@@ -53,9 +53,9 @@ public class EscapeDirective extends Directive {
 			} else if (value != null) {
 				escape(value.toString(), writer);
 			}
-		} catch(TemplateException | ParseException e) {
+		} catch (TemplateException | ParseException e) {
 			throw e;
-		} catch(Exception e) {
+		} catch (Exception e) {
 			throw new TemplateException(e.getMessage(), location, e);
 		}
 	}

+ 2 - 2
src/main/java/com/jfinal/template/stat/ast/Output.java

@@ -67,9 +67,9 @@ public class Output extends Stat {
 			} else if (value != null) {
 				writer.write(value.toString());
 			}
-		} catch(TemplateException | ParseException e) {
+		} catch (TemplateException | ParseException e) {
 			throw e;
-		} catch(Exception e) {
+		} catch (Exception e) {
 			throw new TemplateException(e.getMessage(), location, e);
 		}
 	}