Merge pull request #12015 from RoosterDragon/better-exceptions

Improve some exception types
This commit is contained in:
Paul Chote
2016-09-15 19:31:48 +01:00
committed by GitHub
6 changed files with 7 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits
protected UpgradeMultiplierTrait(UpgradeMultiplierTraitInfo info, string modifierType, string actorType)
{
if (info.Modifier.Length == 0)
throw new Exception("No modifiers in " + modifierType + " for " + actorType);
throw new ArgumentException("No modifiers in " + modifierType + " for " + actorType);
this.info = info;
IsTraitDisabled = info.UpgradeTypes.Length > 0 && info.BaseLevel > 0;
level = IsTraitDisabled ? 0 : info.BaseLevel;