From b7ea695f0c6f9db3c6976b79235476c63c4140e5 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 21 Jan 2011 13:55:31 +1300 Subject: [PATCH] better error when no sequences defined at all --- OpenRA.Game/Graphics/SequenceProvider.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Graphics/SequenceProvider.cs b/OpenRA.Game/Graphics/SequenceProvider.cs index acdedf814c..2e36b04a91 100644 --- a/OpenRA.Game/Graphics/SequenceProvider.cs +++ b/OpenRA.Game/Graphics/SequenceProvider.cs @@ -56,8 +56,12 @@ namespace OpenRA.Graphics try { return units[unitName][sequenceName]; } catch (KeyNotFoundException) { - throw new InvalidOperationException( - "Unit `{0}` does not have a sequence `{1}`".F(unitName, sequenceName)); + if (units.ContainsKey(unitName)) + throw new InvalidOperationException( + "Unit `{0}` does not have a sequence `{1}`".F(unitName, sequenceName)); + else + throw new InvalidOperationException( + "Unit `{0}` does not have any sequences defined.".F(unitName)); } }