lib/pagy/extras/overflow.rb in pagy-3.3.0 vs lib/pagy/extras/overflow.rb in pagy-3.3.1
- old
+ new
@@ -26,11 +26,11 @@
when :empty_page
@offset = @items = @from = @to = 0 # vars relative to the actual page
@prev = @last # prev relative to the actual page
extend(Series) # special series for :empty_page
else
- raise ArgumentError, "expected :overflow variable in [:last_page, :empty_page, :exception]; got #{@vars[:overflow].inspect}"
+ raise VariableError.new(self), "expected :overflow variable in [:last_page, :empty_page, :exception]; got #{@vars[:overflow].inspect}"
end
end
alias_method :initialize, :initialize_with_overflow
module Series
@@ -60,10 +60,10 @@
when :empty_page
@offset = @items = @from = @to = 0 # vars relative to the actual page
@vars[:size] = [] # no page in the series
self
else
- raise ArgumentError, "expected :overflow variable in [:empty_page, :exception]; got #{@vars[:overflow].inspect}"
+ raise VariableError.new(self), "expected :overflow variable in [:empty_page, :exception]; got #{@vars[:overflow].inspect}"
end
end
alias_method :finalize, :finalize_with_overflow
end