static void Main(string[] args) { var main = MainAppFactory.MakeApp(); try { var result = main.Execute(args); Console.WriteLine(JsonConvert.SerializeObject(result)); } catch (Exception e) { Console.Error.WriteLine(JsonConvert.SerializeObject(new SummarizedException(e))); } }
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(); } }