From 8c5d3267e550ed466934d5c44460cdaf0737b3dc Mon Sep 17 00:00:00 2001 From: Theodore Robert Campbell Jr Date: Fri, 22 Jul 2016 16:26:46 -0400 Subject: [PATCH 1/2] Need to commit this to make merges easier --- PokemonGo.RocketAPI.Console/ConsoleLogger.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PokemonGo.RocketAPI.Console/ConsoleLogger.cs b/PokemonGo.RocketAPI.Console/ConsoleLogger.cs index 783b67a23..e142b4a16 100644 --- a/PokemonGo.RocketAPI.Console/ConsoleLogger.cs +++ b/PokemonGo.RocketAPI.Console/ConsoleLogger.cs @@ -48,31 +48,31 @@ public void Write(string message, LogLevel level = LogLevel.Info, ConsoleColor c case LogLevel.Info: System.Console.ForegroundColor = ConsoleColor.DarkCyan; System.Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}] (INFO) {message}"); - break; + break; case LogLevel.Pokestop: System.Console.ForegroundColor = ConsoleColor.Cyan; System.Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}] (POKESTOP) {message}"); - break; + break; case LogLevel.Farming: System.Console.ForegroundColor = ConsoleColor.Magenta; System.Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}] (FARMING) {message}"); - break; + break; case LogLevel.Recycling: System.Console.ForegroundColor = ConsoleColor.DarkMagenta; System.Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}] (RECYCLING) {message}"); - break; + break; case LogLevel.Caught: System.Console.ForegroundColor = ConsoleColor.Green; System.Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}] (CAUGHT) {message}"); - break; + break; case LogLevel.Transfer: System.Console.ForegroundColor = ConsoleColor.DarkGreen; System.Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}] (TRANSFERED) {message}"); - break; + break; case LogLevel.Evolve: System.Console.ForegroundColor = ConsoleColor.Yellow; System.Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}] (EVOLVED) {message}"); - break; + break; case LogLevel.Berry: System.Console.ForegroundColor = ConsoleColor.Magenta; System.Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}] (BERRY) {message}"); From 4eeb850984cf6dbc4c813152d5ad5fe1aea6ced4 Mon Sep 17 00:00:00 2001 From: Theodore Robert Campbell Jr Date: Fri, 22 Jul 2016 16:45:26 -0400 Subject: [PATCH 2/2] Catch AggregateException so we don't die. --- PokemonGo.RocketAPI.Logic/Logic.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PokemonGo.RocketAPI.Logic/Logic.cs b/PokemonGo.RocketAPI.Logic/Logic.cs index 8381cfd4f..1defa425b 100644 --- a/PokemonGo.RocketAPI.Logic/Logic.cs +++ b/PokemonGo.RocketAPI.Logic/Logic.cs @@ -253,6 +253,11 @@ public async Task Execute() Logger.Write("InvalidResponseException - Restarting", LogLevel.Error); await Execute(); } + catch (AggregateException) + { + Logger.Write("AggregateException - Restarting", LogLevel.Error); + await Execute(); + } await Task.Delay(10000); } }