Raise Liquid::ZeroDivisionError instead of ZeroDivisionError.

This commit is contained in:
Dylan Thacker-Smith
2015-05-21 12:18:58 -04:00
parent 71ff1f283a
commit 3d87d9ab1e
2 changed files with 3 additions and 0 deletions

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

View File

@@ -279,6 +279,8 @@ module Liquid
# division
def divided_by(input, operand)
apply_operation(input, operand, :/)
rescue ::ZeroDivisionError => e
raise Liquid::ZeroDivisionError.new(e.message)
end
def modulo(input, operand)