Browse Source

Better formatting for yaml config errors

Print them nicely instead of treating them as unhandled.
davidfowl/ingress-changes
Ryan Nowak 7 years ago
parent
commit
4436688af7
  1. 11
      src/tye/Program.cs

11
src/tye/Program.cs

@ -11,6 +11,7 @@ using System.CommandLine.IO;
using System.CommandLine.Parsing;
using System.Reflection;
using System.Threading.Tasks;
using Tye.Serialization;
namespace Microsoft.Tye
{
@ -78,6 +79,16 @@ namespace Microsoft.Tye
context.Console.Error.WriteLine(command.InnerException.ToString());
}
}
else if (exception is TyeYamlException yaml)
{
context.Console.Error.WriteLine($"{yaml.Message}");
if (yaml.InnerException != null)
{
context.Console.Error.WriteLine();
context.Console.Error.WriteLine(yaml.InnerException.ToString());
}
}
else
{
context.Console.Error.WriteLine("An unhandled exception has occurred, how unseemly: ");

Loading…
Cancel
Save