Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
raise if shard cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
freels committed Oct 20, 2010
1 parent 0a1909e commit b4b2d85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/gizzard/nameserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def build_tree(enum, shard_id, link_weight)
build_tree(enum, child_id, child_weight)
end

template = ShardTemplate.from_shard_info(shards[shard_id], link_weight, children)
info = shards[shard_id] or raise "shard info not found for: #{shard_id}"
template = ShardTemplate.from_shard_info(info, link_weight, children)

canonical_id = template.to_shard_id(@config.shard_name(enum))
@existing_shard_ids[canonical_id] = shard_id
Expand Down

0 comments on commit b4b2d85

Please sign in to comment.