diff --git a/RecrownedAthenaeum.ConsoleTools/CommandProcessor/CommandEngine.cs b/RecrownedAthenaeum.ConsoleTools/CommandProcessor/CommandEngine.cs index 644b8b1..793928c 100644 --- a/RecrownedAthenaeum.ConsoleTools/CommandProcessor/CommandEngine.cs +++ b/RecrownedAthenaeum.ConsoleTools/CommandProcessor/CommandEngine.cs @@ -24,9 +24,9 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor Process(command); } - catch (ArgumentException) + catch (ArgumentException ae) { - Console.WriteLine("Command not found."); + Console.WriteLine("Error: " + ae.Message); } } } @@ -39,7 +39,7 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor if (commandAndArguments.Contains(' ')) { command = command.Remove(command.IndexOf(' ')); - if (!commands.ContainsKey(command)) throw new ArgumentException(); + if (!commands.ContainsKey(command)) throw new ArgumentException("Command not found."); string[] argumentsSplit = commandAndArguments.Remove(command.Length).Split(' '); List argumentsList = new List(); @@ -55,7 +55,7 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor i++; if (i >= argumentsSplit.Length) { - throw new ArgumentException(); + throw new ArgumentException("Argument is missing terminating \'\"\'"); } } while (!argumentsSplit[i].Contains('"')); @@ -70,7 +70,7 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor } arguments = argumentsList.ToArray(); } - if (!commands.ContainsKey(command)) throw new ArgumentException(); + if (!commands.ContainsKey(command)) throw new ArgumentException("Command not found."); commands[command].Run(arguments); } }