lib/usher/util/generate.rb in usher-0.6.5 vs lib/usher/util/generate.rb in usher-0.6.6
- old
+ new
@@ -19,17 +19,17 @@
path.parts.each do |part|
case part
when String
result << part
when Route::Variable::Glob
- value = (params && params.delete(part.name)) || part.default_value || raise(MissingParameterException.new)
+ value = (params && params.delete(part.name)) || part.default_value || raise(MissingParameterException.new("expected a value for #{part.name}"))
value.each_with_index do |current_value, index|
part.valid!(current_value)
result << current_value.to_s
result << usher.delimiters.first if index != value.size - 1
end
when Route::Variable
- value = (params && params.delete(part.name)) || part.default_value || raise(MissingParameterException.new)
+ value = (params && params.delete(part.name)) || part.default_value || raise(MissingParameterException.new("expected a value for #{part.name}"))
part.valid!(value)
result << value.to_s
end
end
else