From 3647de639b656bdc26f02ca4c32c47714ef0f977 Mon Sep 17 00:00:00 2001 From: Jonas Nilson Date: Sun, 31 May 2020 21:00:48 +0200 Subject: [PATCH] Exception ignored are now logged --- Source/IdleMaster/Program.cs | 4 ++-- Source/IdleMaster/frmBrowser.cs | 4 ++-- Source/IdleMaster/frmMain.cs | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/IdleMaster/Program.cs b/Source/IdleMaster/Program.cs index 37addb10..063ce969 100644 --- a/Source/IdleMaster/Program.cs +++ b/Source/IdleMaster/Program.cs @@ -21,9 +21,9 @@ static void Main() String programName = Path.GetFileName(Environment.GetCommandLineArgs()[0]); key.SetValue(programName, (int)10001, RegistryValueKind.DWord); } - catch (Exception) + catch (Exception ex) { - + Logger.Exception(ex, "Program -> Main -> Registry and environment modifications resulted in an exception."); } Application.ThreadException += (o, a) => Logger.Exception(a.Exception); diff --git a/Source/IdleMaster/frmBrowser.cs b/Source/IdleMaster/frmBrowser.cs index 19f9648a..08f9d256 100644 --- a/Source/IdleMaster/frmBrowser.cs +++ b/Source/IdleMaster/frmBrowser.cs @@ -61,9 +61,9 @@ private void wbAuth_DocumentCompleted(object sender, WebBrowserDocumentCompleted { globalHeader.parentNode.removeChild(globalHeader); } - catch (Exception) + catch (Exception ex) { - + Logger.Exception(ex, "frmBrowswer -> wbAuth_DocumentCompleted -> Removing the global_header resulted in an exception"); } } diff --git a/Source/IdleMaster/frmMain.cs b/Source/IdleMaster/frmMain.cs index 329f1c96..9ee7b0fb 100644 --- a/Source/IdleMaster/frmMain.cs +++ b/Source/IdleMaster/frmMain.cs @@ -95,9 +95,9 @@ public void SortBadges(string method) } AllBadges = AllBadges.OrderByDescending(b => b.AveragePrice).ToList(); } - catch + catch (Exception ex) { - + Logger.Exception(ex, "frmMain -> SortBadges -> The method (mostvalue) resulted in an exception"); } break; default: @@ -194,9 +194,9 @@ private void StartIdle() } } - catch (Exception) + catch (Exception ex) { - + Logger.Exception(ex, "frmMain -> StartIdle -> The attempt to kill rogue processes resulted in an exception."); } // Check if user is authenticated and if any badge left to idle @@ -305,7 +305,7 @@ public void StopIdle() } catch (Exception ex) { - Logger.Exception(ex, "frmMain -> StopIdle"); + Logger.Exception(ex, "frmMain -> StopIdle -> An attempt to stop the idling processes resulted in an exception."); } }