lib/roda/endpoints/repository.rb in roda-endpoints-0.3.1 vs lib/roda/endpoints/repository.rb in roda-endpoints-0.3.2
- old
+ new
@@ -17,9 +17,13 @@
end
# @param [Integer] id
# @return [ROM::Struct]
def fetch(id)
+ if id.to_i < 1
+ raise ArgumentError,
+ "#{self.class}#fetch: invalid id provided: #{id.inspect}"
+ end
root.fetch(id.to_i)
end
end
end
end