public
Rubygem
Description: Liquid markup language. Save, customer facing template language for flexible web apps.
Homepage: http://www.liquidmarkup.org
Clone URL: git://github.com/tobi/liquid.git
Click here to lend your support to: liquid and make a donation at www.pledgie.com !
Parse time errors should propagate to calling site
Tobias Lütke (author)
Thu May 08 09:35:17 -0700 2008
commit  8f45647aa37d784163980e9e23e4e515d5ecfd70
tree    ad8dfa06d85eca728176202db9e773f10593fd83
parent  4c0cfae0b725cd6945fcdd495b0c877b08b8a90b
...
42
43
44
45
 
46
47
48
 
 
 
 
49
50
51
...
42
43
44
 
45
46
 
 
47
48
49
50
51
52
53
0
@@ -42,10 +42,12 @@ module Liquid
0
     def handle_error(e)
0
       errors.push(e)
0
       raise if @rethrow_errors
0
-
0
+
0
       case e
0
- when SyntaxError then "Liquid syntax error: #{e.message}"
0
- else "Liquid error: #{e.message}"
0
+ when SyntaxError
0
+ "Liquid syntax error: #{e.message}"
0
+ else
0
+ "Liquid error: #{e.message}"
0
       end
0
     end
0
     
...
59
60
61
62
 
63
64
 
65
66
67
68
69
70
71
72
73
...
59
60
61
 
62
63
 
64
65
66
 
 
 
 
67
68
69
0
@@ -59,15 +59,11 @@ class ErrorHandlingTest < Test::Unit::TestCase
0
     
0
   end
0
   
0
- def test_missing_endtag
0
+ def test_missing_endtag_parse_time_error
0
     
0
- assert_nothing_raised do
0
+ assert_raise(Liquid::SyntaxError) do
0
       
0
       template = Liquid::Template.parse(' {% for a in b %} ... ')
0
- assert_equal ' Liquid error: Unknown operator =! ', template.render
0
-
0
- assert_equal 1, template.errors.size
0
- assert_equal Liquid::SyntaxError, template.errors.first.class
0
       
0
     end
0
     

Comments

    No one has commented yet.