Skip to content

Commit

Permalink
Better error message for #75
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Jul 14, 2014
1 parent 39473f8 commit dafd227
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/i18n/tasks/data/tree/siblings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ def set(full_key, node)
child = Node.new(key: key_part, parent: parent, children: [])
append! child
end
child.children.set rest, node
if child.children
child.children.set rest, node
else
raise CommandError.new("Failed to add children to #{child.full_key} because it has a value: #{child.value.inspect}")
end
else
remove! child if child
append! node
Expand Down

0 comments on commit dafd227

Please sign in to comment.