From 8a676c573adf4ffbdf85e7b16474e36204147903 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 7 Nov 2019 07:40:04 +1100 Subject: [PATCH 1/3] Fix error message logging for prod run --- Plugins/Wox.Plugin.Program/Programs/UWP.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Wox.Plugin.Program/Programs/UWP.cs b/Plugins/Wox.Plugin.Program/Programs/UWP.cs index 360b744319..8fef2e49bf 100644 --- a/Plugins/Wox.Plugin.Program/Programs/UWP.cs +++ b/Plugins/Wox.Plugin.Program/Programs/UWP.cs @@ -157,7 +157,7 @@ namespace Wox.Plugin.Program.Programs #if !DEBUG catch (Exception e) { - ProgramLogger.LogException("|UWP|All|An unexpected error occured and " + ProgramLogger.LogException($"|UWP|All|{p.InstalledLocation}|An unexpected error occured and " + $"unable to convert Package to UWP for {p.Id.FullName}", e); return new Application[] { }; } From 46274acb3ebb94cd53c78cac41188331e852e8fc Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 7 Nov 2019 07:46:18 +1100 Subject: [PATCH 2/3] Add error message specification --- Plugins/Wox.Plugin.Program/Logger/ProgramLogger.cs | 3 ++- Plugins/Wox.Plugin.Program/Programs/UWP.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Plugins/Wox.Plugin.Program/Logger/ProgramLogger.cs b/Plugins/Wox.Plugin.Program/Logger/ProgramLogger.cs index c8a104b101..ed3dd89427 100644 --- a/Plugins/Wox.Plugin.Program/Logger/ProgramLogger.cs +++ b/Plugins/Wox.Plugin.Program/Logger/ProgramLogger.cs @@ -41,7 +41,8 @@ namespace Wox.Plugin.Program.Logger } /// - /// Please follow exception format: |class name|calling method name|loading program path|user friendly message that explains the error + /// Please follow exception format, there are four parts to an error message that need to be specified: + /// |class name|calling method name|loading program path|user friendly message that explains the error /// => Example: |Win32|LnkProgram|c:\..\chrome.exe|Permission denied on directory, but Wox should continue /// [MethodImpl(MethodImplOptions.Synchronized)] diff --git a/Plugins/Wox.Plugin.Program/Programs/UWP.cs b/Plugins/Wox.Plugin.Program/Programs/UWP.cs index 8fef2e49bf..cb1fa54211 100644 --- a/Plugins/Wox.Plugin.Program/Programs/UWP.cs +++ b/Plugins/Wox.Plugin.Program/Programs/UWP.cs @@ -163,9 +163,9 @@ namespace Wox.Plugin.Program.Programs } #endif #if DEBUG //make developer aware and implement handling - catch(Exception) + catch(Exception e) { - throw; + throw e; } #endif return u.Apps; From 5b7a71fb080b2228afa271c2575e2900d813788c Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Fri, 8 Nov 2019 05:38:40 +1100 Subject: [PATCH 3/3] Fix missing required parameter in logger --- Plugins/Wox.Plugin.Program/Programs/UWP.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Wox.Plugin.Program/Programs/UWP.cs b/Plugins/Wox.Plugin.Program/Programs/UWP.cs index 5c4c3cdeb1..60f978b9dc 100644 --- a/Plugins/Wox.Plugin.Program/Programs/UWP.cs +++ b/Plugins/Wox.Plugin.Program/Programs/UWP.cs @@ -207,7 +207,7 @@ namespace Wox.Plugin.Program.Programs } catch (Exception e) { - ProgramLogger.LogException("|UWP|CurrentUserPackages|An unexpected error occured and " + ProgramLogger.LogException("|UWP|CurrentUserPackages|Not available|An unexpected error occured and " + $"unable to verify if package is valid", e); return false; }