Raise Liquid::ZeroDivisionError instead of ZeroDivisionError.

This commit is contained in:
Dylan Thacker-Smith
2015-05-25 15:40:17 -04:00
parent 8af99ff918
commit 6265c36ec9
3 changed files with 6 additions and 3 deletions
+1
View File
@@ -57,4 +57,5 @@ module Liquid
StackLevelError = Class.new(Error)
TaintedError = Class.new(Error)
MemoryError = Class.new(Error)
ZeroDivisionError = Class.new(Error)
end
+2
View File
@@ -279,6 +279,8 @@ module Liquid
# division
def divided_by(input, operand)
apply_operation(input, operand, :/)
rescue ::ZeroDivisionError => e
raise Liquid::ZeroDivisionError, e.message
end
def modulo(input, operand)