display where duplicate keys in MiniYaml are found

This commit is contained in:
Matthias Mailänder
2013-08-17 23:27:45 +02:00
parent 8c6074a081
commit 018ceb8d82
2 changed files with 6 additions and 6 deletions

View File

@@ -93,7 +93,7 @@ namespace OpenRA.FileFormats
foreach (var y in Nodes)
{
if (ret.ContainsKey(y.Key))
throw new InvalidDataException("Duplicate key `{0}' in MiniYaml".F(y.Key));
throw new InvalidDataException("Duplicate key `{0}' in {1}".F(y.Key, y.Location));
ret.Add(y.Key, y.Value);
}

View File

@@ -27,7 +27,7 @@ namespace OpenRA
{
var key = w.Key.Substring( w.Key.IndexOf('@') + 1);
if (widgets.ContainsKey(key))
throw new InvalidDataException("Widget has duplicate Key `{0}`".F(w.Key));
throw new InvalidDataException("Widget has duplicate Key `{0}` at {1}".F(w.Key, w.Location));
widgets.Add(key, w);
}
}