# HG changeset patch # User IBBoard # Date 1267282962 0 # Node ID 91ee6259677f8e27f36da33ab70c3a1d8def4d2a # Parent 50f845c117e9396885916be48afd73f9ca5368d1 * Make "armourType" parse error more informative no-open-ticket diff -r 50f845c117e9 -r 91ee6259677f api/Factories/Xml/WarFoundryXmlRaceFactory.cs --- a/api/Factories/Xml/WarFoundryXmlRaceFactory.cs Sat Feb 27 14:44:09 2010 +0000 +++ b/api/Factories/Xml/WarFoundryXmlRaceFactory.cs Sat Feb 27 15:02:42 2010 +0000 @@ -440,13 +440,15 @@ throw new InvalidFileException("Attribute 'cost' of equipment item "+id+" was not a valid number", ex); } + string armourTypeAttrib = elem.GetAttribute("armourType"); + try { - armourType = (ArmourType)Enum.Parse(typeof(ArmourType), elem.GetAttribute("armourType")); + armourType = (ArmourType)Enum.Parse(typeof(ArmourType), armourTypeAttrib); } catch(ArgumentException ex) { - throw new InvalidFileException("Attribute 'armourType' of equipment "+id+" was not a valid value from the enumeration", ex); + throw new InvalidFileException("Attribute value '"+armourTypeAttrib+"' for 'armourType' of equipment "+id+" was not one of the allowed values", ex); } //TODO: Parse equipment stats if there are any