mirror of
https://github.com/kemko/liquid.git
synced 2026-01-08 11:15:40 +03:00
Raise Liquid::ZeroDivisionError instead of ZeroDivisionError.
This commit is contained in:
@@ -57,4 +57,5 @@ module Liquid
|
||||
StackLevelError = Class.new(Error)
|
||||
TaintedError = Class.new(Error)
|
||||
MemoryError = Class.new(Error)
|
||||
ZeroDivisionError = Class.new(Error)
|
||||
end
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user