lib/dentaku/ast/function.rb in dentaku-3.2.0 vs lib/dentaku/ast/function.rb in dentaku-3.2.1

- old
+ new

@@ -39,10 +39,11 @@ if value.is_a?(::String) number = value[/\A-?\d*\.?\d+\z/] return number.include?('.') ? ::BigDecimal.new(number, DIG) : number.to_i if number end - raise TypeError, "#{value || value.class} could not be cast to a number." + raise Dentaku::ArgumentError.for(:incompatible_type, value: value, for: Numeric), + "'#{value || value.class}' is not coercible to numeric" end end end end