Ejemplo n.º 1
0
 public SummarizedException(Exception e)
 {
     Type    = e.GetType();
     Message = e.Message;
     if (!(e.InnerException is null))
     {
         InnerException = new SummarizedException(e.InnerException);
     }
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var main = MainAppFactory.MakeApp("./levels");

            var input = Console.ReadLine();

            while (input != "quit")
            {
                object result = "No output returned.";
                try
                {
                    result = main.Execute(input.Split(' '));
                }catch (Exception e)
                {
                    result = new SummarizedException(e);
                }
                finally
                {
                    Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(result));
                }
                input = Console.ReadLine();
            }
        }